mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 10:25:18 +00:00
add command-line overwrite capability to setup.py
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
2c8df54b70
commit
2e52029114
|
@ -129,6 +129,17 @@ def _configure_z3():
|
|||
for key, val in cmake_options.items():
|
||||
if type(val) is bool:
|
||||
cmake_options[key] = str(val).upper()
|
||||
|
||||
# Allow command-line arguments to add and override Z3_ options
|
||||
for i in range(len(sys.argv) - 1):
|
||||
key = sys.argv[i]
|
||||
if key.starts_with("Z3_"):
|
||||
val = sys.argv[i + 1]
|
||||
if val.lower() == "true":
|
||||
cmake_options[key] = "TRUE"
|
||||
elif val.lower() == "false":
|
||||
cmake_options[key] = "FALSE"
|
||||
|
||||
cmake_args = [ '-D' + key + '=' + value for key,value in cmake_options.items() ]
|
||||
args = [ 'cmake', *cmake_args, SRC_DIR ]
|
||||
if subprocess.call(args, env=build_env, cwd=BUILD_DIR) != 0:
|
||||
|
|
Loading…
Reference in a new issue