mirror of
https://github.com/Z3Prover/z3
synced 2025-06-13 09:26:15 +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
1 changed files with 11 additions and 0 deletions
|
@ -129,6 +129,17 @@ def _configure_z3():
|
||||||
for key, val in cmake_options.items():
|
for key, val in cmake_options.items():
|
||||||
if type(val) is bool:
|
if type(val) is bool:
|
||||||
cmake_options[key] = str(val).upper()
|
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() ]
|
cmake_args = [ '-D' + key + '=' + value for key,value in cmake_options.items() ]
|
||||||
args = [ 'cmake', *cmake_args, SRC_DIR ]
|
args = [ 'cmake', *cmake_args, SRC_DIR ]
|
||||||
if subprocess.call(args, env=build_env, cwd=BUILD_DIR) != 0:
|
if subprocess.call(args, env=build_env, cwd=BUILD_DIR) != 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue