Skip to content

Commit 2dd25c2

Browse files
meson: Move config.h to root directory
Similar to the commit in audacious-core with the difference that mpg123 still needs the generated config.h file in src/.
1 parent 7a42427 commit 2dd25c2

3 files changed

Lines changed: 9 additions & 16 deletions

File tree

File renamed without changes.

meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,19 @@ if cc.get_id() in ['gcc', 'clang']
101101
check_cflags = common_flags
102102
check_cxxflags = common_flags + cxx_flags
103103

104+
config_h_full_path = join_paths(meson.current_build_dir(), 'src', 'config.h')
105+
104106
add_project_arguments(cc.get_supported_arguments(check_cflags), language: 'c')
105107
add_project_arguments(cxx.get_supported_arguments(check_cxxflags), language: 'cpp')
108+
add_project_arguments('-include', config_h_full_path, language: ['c', 'cpp'])
106109

107110
if have_darwin
108111
add_project_arguments(objc.get_supported_arguments(check_cflags), language: 'objc')
109112
add_project_arguments(objcpp.get_supported_arguments(check_cxxflags), language: 'objcpp')
113+
add_project_arguments('-include', config_h_full_path, language: ['objc', 'objcpp'])
110114
endif
115+
else
116+
error('Please implement -include handling for your chosen compiler.')
111117
endif
112118

113119

src/meson.build

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
src_inc = include_directories('.')
22

33

4-
config_h_full_path = join_paths(meson.current_build_dir(), 'config.h')
5-
6-
7-
if cc.get_id() in ['gcc', 'clang']
8-
add_project_arguments('-include', config_h_full_path, language: ['c', 'cpp'])
9-
10-
if have_darwin
11-
add_project_arguments('-include', config_h_full_path, language: ['objc', 'objcpp'])
12-
endif
13-
else
14-
error('Please implement -include handling for your chosen compiler.')
15-
endif
16-
17-
184
# input plugins
195
subdir('metronom')
206
subdir('psf')
@@ -290,6 +276,7 @@ endif
290276

291277

292278
# config.h stuff
293-
configure_file(input: 'config.h.meson',
279+
configure_file(input: '../config.h.meson',
294280
output: 'config.h',
295-
configuration: conf)
281+
configuration: conf
282+
)

0 commit comments

Comments
 (0)