[v2,1/2] build: make version file optional for drivers
Checks
Commit Message
In this patch, we removed the necessity of the version files and
you don't need to update these files for each release, you can just
remove them.
Signed-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
Suggested-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
Depends on: patch-116222 ("build: increase minimum meson version to 0.53")
---
drivers/meson.build | 67 +++++++++++++++++++++++++--------------------
1 file changed, 37 insertions(+), 30 deletions(-)
Comments
On Tue, Oct 11, 2022 at 02:08:49PM +0300, Abdullah Ömer Yamaç wrote:
> In this patch, we removed the necessity of the version files and
> you don't need to update these files for each release, you can just
> remove them.
>
> Signed-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
> Suggested-by: Ferruh Yigit <ferruh.yigit@amd.com>
>
> ---
> Depends on: patch-116222 ("build: increase minimum meson version to 0.53")
This patch is merged now, so you no longer need to call it out as
dependency.
Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2019 Intel Corporation
+fs = import('fs')
+
# Defines the order of dependencies evaluation
subdirs = [
'common',
@@ -201,39 +203,44 @@ foreach subpath:subdirs
# now build the shared driver
version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path)
implib = 'lib' + lib_name + '.dll.a'
-
- def_file = custom_target(lib_name + '_def',
- command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
- input: version_map,
- output: '@0@_exports.def'.format(lib_name))
-
- mingw_map = custom_target(lib_name + '_mingw',
- command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
- input: version_map,
- output: '@0@_mingw.map'.format(lib_name))
-
- lk_deps = [version_map, def_file, mingw_map]
- if is_windows
- if is_ms_linker
- lk_args = ['-Wl,/def:' + def_file.full_path()]
- if meson.version().version_compare('<0.54.0')
- lk_args += ['-Wl,/implib:drivers\\' + implib]
+
+ lk_deps = []
+ lk_args = []
+ if fs.is_file(version_map)
+ def_file = custom_target(lib_name + '_def',
+ command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
+ input: version_map,
+ output: '@0@_exports.def'.format(lib_name))
+
+ mingw_map = custom_target(lib_name + '_mingw',
+ command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
+ input: version_map,
+ output: '@0@_mingw.map'.format(lib_name))
+
+ lk_deps = [version_map, def_file, mingw_map]
+ if is_windows
+ if is_ms_linker
+ lk_args = ['-Wl,/def:' + def_file.full_path()]
+ if meson.version().version_compare('<0.54.0')
+ lk_args += ['-Wl,/implib:drivers\\' + implib]
+ endif
+ else
+ lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
endif
else
- lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
- endif
- else
- lk_args = ['-Wl,--version-script=' + version_map]
- if developer_mode
- # on unix systems check the output of the
- # check-symbols.sh script, using it as a
- # dependency of the .so build
- lk_deps += custom_target(lib_name + '.sym_chk',
- command: [check_symbols, version_map, '@INPUT@'],
- capture: true,
- input: static_lib,
- output: lib_name + '.sym_chk')
+ lk_args = ['-Wl,--version-script=' + version_map]
+ if developer_mode
+ # on unix systems check the output of the
+ # check-symbols.sh script, using it as a
+ # dependency of the .so build
+ lk_deps += custom_target(lib_name + '.sym_chk',
+ command: [check_symbols, version_map, '@INPUT@'],
+ capture: true,
+ input: static_lib,
+ output: lib_name + '.sym_chk')
+ endif
endif
+
endif
shared_lib = shared_library(lib_name, sources,