From f342794376db003e92df2e5a597d2e30ff0a2d74 Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Sat, 6 Apr 2024 22:08:38 +0200 Subject: [PATCH] fix meson files. --- meson.build | 23 +++++++++++++---------- meson_options.txt | 8 +++++--- tests/unit/meson.build | 1 - 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index 300331dc80..f193336513 100644 --- a/meson.build +++ b/meson.build @@ -1081,21 +1081,23 @@ if targetos == 'linux' and (have_system or have_tools) required: get_option('libudev')) endif -symcc_backend = get_option('symcc_backend') +symcc_rt_backend = get_option('symcc_rt_backend') if not fs.is_file('subprojects/symcc-rt/RuntimeCommon.h') - error_msg='''The SymCC source path "@0@" is incorrect. -Did you initialize symcc-rt subrepository? (git submodule update --init --recursive subprojects/symcc-rt)'''.format('subprojects/symcc') - error(error_msg) + error('''Symcc Runtime does not seem to be present. +Did you initialize the symcc-rt submodule? (git submodule update --init --recursive subprojects/symcc-rt)''') endif symcc_rt = not_found -symcc_var = cmake.subproject_options() -symcc_var.add_cmake_defines({ 'SYMCC_RT_BACKEND': symcc_backend }) +symcc_rt_vars = cmake.subproject_options() +symcc_rt_vars.add_cmake_defines({ + 'SYMCC_RT_BACKEND': symcc_rt_backend, + 'Z3_TRUST_SYSTEM_VERSION': get_option('symcc_rt_trust_system_z3'), +}) -symcc_rt_proj = cmake.subproject('symcc-rt', options: symcc_var) -if get_option('symcc_shared') +symcc_rt_proj = cmake.subproject('symcc-rt', options: symcc_rt_vars) +if get_option('symcc_rt_shared') symcc_rt = symcc_rt_proj.dependency('SymccRtShared') else symcc_rt = symcc_rt_proj.dependency('SymccRtStatic') @@ -4363,8 +4365,9 @@ summary(summary_info, bool_yn: true, section: 'Network backends') # SymQEMU summary_info = {} -summary_info += {'SymCC Backend': symcc_backend} -summary_info += {'SymCC Shared Library': get_option('symcc_shared')} +summary_info += {'SymCC Runtime Backend': symcc_rt_backend} +summary_info += {'SymCC Runtime trust system\'s Z3': get_option('symcc_rt_trust_system_z3')} +summary_info += {'SymCC Shared Library': get_option('symcc_rt_shared')} summary(summary_info, bool_yn: true, section: 'SymQEMU') # Libraries diff --git a/meson_options.txt b/meson_options.txt index 5a33a3d934..33d3bc7fc0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -370,7 +370,9 @@ option('hexagon_idef_parser', type : 'boolean', value : true, description: 'use idef-parser to automatically generate TCG code for the Hexagon frontend') # SymQEMU related options -option('symcc_backend', type: 'string', value: 'qsym', - description: 'SymCC backend to use. Please check SymCC Runtime for a list of available backends.') -option('symcc_shared', type: 'boolean', value: false, +option('symcc_rt_backend', type: 'string', value: 'qsym', + description: 'SymCC Runtime backend to use. Please check SymCC Runtime for a list of available backends.') +option('symcc_rt_trust_system_z3', type: 'boolean', value: true, + description: 'Trust the system version of Z3 to build SymCC Runtime') +option('symcc_rt_shared', type: 'boolean', value: true, description: 'Compile SymCC Runtime dynamically instead of statically.') diff --git a/tests/unit/meson.build b/tests/unit/meson.build index a865f1593c..45837648fa 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -192,7 +192,6 @@ foreach test_name, extra: tests # SymQEMU unit tests executable construction if test_name == 'check-sym-runtime' - deps += [symcc_rt] # embeds most of qemu objects, including SymQEMU