[gssdp] build: Move config.h to private subdirectory



commit c3a2aff7aa7f692bdc1b6f7f6b702c74c8e534e7
Author: Jens Georg <mail jensge org>
Date:   Sat Jun 19 18:19:11 2021 +0200

    build: Move config.h to private subdirectory
    
    This is necessary for using it as a submodule, see
    
    https://mesonbuild.com/Wrap-best-practices-and-tips.html#do-not-put-configh-in-external-search-path

 internal/meson.build | 5 +++++
 meson.build          | 6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/internal/meson.build b/internal/meson.build
new file mode 100644
index 0000000..583ce8f
--- /dev/null
+++ b/internal/meson.build
@@ -0,0 +1,5 @@
+config_h = configure_file(output : 'config.h', configuration : conf)
+config_header = declare_dependency(
+    compile_args : '-DHAVE_CONFIG_H=1',
+    include_directories: include_directories('.')
+)
diff --git a/meson.build b/meson.build
index 6f327e8..7e9ad13 100644
--- a/meson.build
+++ b/meson.build
@@ -36,11 +36,9 @@ siocgifindex_available = cc.compiles(siocgifindex_test,
                                      name : 'SIOCGIFINDEX is available')
 conf.set('HAVE_SIOCGIFINDEX', siocgifindex_available)
 
-configure_file(output : 'config.h', configuration : conf)
+subdir('internal')
 
-add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
-
-system_deps = []
+system_deps = [config_header]
 
 # Check whether we are compiling against Android libc
 bionic_test = '''#include <sys/cdefs.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]