build: add build path variables
authorJohn Marshall <jtm.home@gmail.com>
Wed, 27 May 2020 11:20:10 +0000 (12:20 +0100)
committerJohn Marshall <jtm.home@gmail.com>
Thu, 25 Jun 2020 07:06:44 +0000 (08:06 +0100)
  - add build path variables for library and extensions

babl/meson.build
docs/meson.build
extensions/meson.build
tests/meson.build

index 6feb107ba14da25949ea3abaac67ad574368177b..37d2e4d77e46b3b92fdb402d9a7bdf50d32e5fc0 100644 (file)
@@ -1,3 +1,5 @@
+babl_library_build_dir = meson.current_build_dir()
+
 bablInclude = include_directories('.')
 subdir('base')
 
index 74984b0c597490d53566985c468ce07c8b4b1365..4a771b5ff9d52e566499e5821ee95d160f9dfbe8 100644 (file)
@@ -23,14 +23,14 @@ babl_css = configure_file(
 )
 
 index_html_tmp_env = [
-  'BABL_PATH=' + meson.build_root() / 'extensions',
+  'BABL_PATH=' + babl_extensions_build_dir,
 ]
 
 # Don't build babl ref if cannot run compiled objects in this env
-if env_bin.found() and cc_can_run # and not meson.is_cross_build()
+if env_bin.found() and cc_can_run
   index_html_tmp = custom_target('index.html.tmp',
-    input : [ babl_html_dump, ],
-    output: [ 'index.html.tmp', ],
+    input : babl_html_dump,
+    output:'index.html.tmp',
     command: [
       env_bin,
       index_html_tmp_env,
index acfbbcb97cdddb3214de2d6d7209d90e1f102427..8d96066431fd5c6a109b4b92255c854d315946b8 100644 (file)
@@ -1,3 +1,5 @@
+babl_extensions_build_dir = meson.current_build_dir()
+
 no_cflags = []
 
 # Dependencies
index 4431ed81eb7e98d55421e69fd604eb22a291eb11..8be32f7ed50ebe477f5c6e794070bde596721fdd 100644 (file)
@@ -34,9 +34,9 @@ if platform_unix
 endif
 
 test_env = environment()
-test_env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'babl'))
-test_env.set('GI_TYPELIB_PATH', join_paths(meson.build_root(), 'babl'))
-test_env.set('BABL_PATH', join_paths(meson.build_root(), 'extensions'))
+test_env.prepend('LD_LIBRARY_PATH', babl_library_build_dir)
+test_env.set('GI_TYPELIB_PATH', babl_library_build_dir)
+test_env.set('BABL_PATH', babl_extensions_build_dir)
 foreach test_name : test_names
   test = executable(
     test_name,