[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: meson: fix writing pkg_config_libdir

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri Feb 4 16:04:01 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
09154ece by Marvin Scholz at 2022-02-04T13:49:43+00:00
contrib: meson: fix writing pkg_config_libdir

Write pkg_config_libdir to the correct crossfile section, should
fix the build after 74060949afbbca285fefdc746f61ff43ed2cb213.

- - - - -
a86a62c9 by Marvin Scholz at 2022-02-04T13:49:43+00:00
contrib: meson: do not treat no env var as empty

Do not write env variable values that are not set to the crossfile
as empty strings as there is a difference between no value and the
empty string for some variables.

- - - - -


1 changed file:

- contrib/src/gen-meson-crossfile.py


Changes:

=====================================
contrib/src/gen-meson-crossfile.py
=====================================
@@ -12,14 +12,17 @@ args = parser.parse_args()
 
 # Helper to add env variable value to crossfile
 def _add_environ_val(meson_key, env_key):
-    env_value = os.environ.get(env_key, '')
-    args.file.write("{} = '{}'\n".format(meson_key, env_value))
+    env_value = os.environ.get(env_key)
+    if env_value != None:
+        args.file.write("{} = '{}'\n".format(meson_key, env_value))
 
 # Helper to add env variable array to crossfile
 def _add_environ_arr(meson_key, env_key):
-    env_values = shlex.split(os.environ.get(env_key, ''))
-    arr_string = (', '.join("'" + item + "'" for item in env_values))
-    args.file.write("{} = [{}]\n".format(meson_key, arr_string))
+    env_array = os.environ.get(env_key)
+    if env_array != None:
+        env_values = shlex.split(env_array)
+        arr_string = (', '.join("'" + item + "'" for item in env_values))
+        args.file.write("{} = [{}]\n".format(meson_key, arr_string))
 
 # Generate meson crossfile
 args.file.write("# Automatically generated by contrib makefile\n")
@@ -34,12 +37,12 @@ if os.environ.get('HOST_SYSTEM') == 'darwin':
 _add_environ_val('ar', 'AR')
 _add_environ_val('strip', 'STRIP')
 _add_environ_val('pkgconfig', 'PKG_CONFIG')
-_add_environ_val('pkg_config_libdir', 'PKG_CONFIG_LIBDIR')
 _add_environ_val('windres', 'WINDRES')
 
 # Properties section
 args.file.write("\n[properties]\n")
 args.file.write("needs_exe_wrapper = true\n")
+_add_environ_val('pkg_config_libdir', 'PKG_CONFIG_LIBDIR')
 _add_environ_arr('c_args', 'CFLAGS')
 _add_environ_arr('c_link_args', 'LDFLAGS')
 _add_environ_arr('cpp_args', 'CXXFLAGS')



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c8e64fe723daa8bccd0421599f844abd53623ddd...a86a62c9351686ed3b9930063adc6ebc199c4ab9

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c8e64fe723daa8bccd0421599f844abd53623ddd...a86a62c9351686ed3b9930063adc6ebc199c4ab9
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list