diff --git a/cmake/z3_add_component.cmake b/cmake/z3_add_component.cmake index 8ab6e045d..ac6d1ec06 100644 --- a/cmake/z3_add_component.cmake +++ b/cmake/z3_add_component.cmake @@ -262,18 +262,20 @@ macro(z3_add_install_tactic_rule) GLOBAL PROPERTY Z3_${dependency}_TACTIC_HEADERS ) - list(APPEND _tactic_header_files ${_component_tactic_header_files}) + list(APPEND _tactic_header_files "${_component_tactic_header_files}") endforeach() unset(_component_tactic_header_files) + string(REPLACE ";" "\n" _tactic_header_files "${_tactic_header_files}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps" ${_tactic_header_files}) add_custom_command(OUTPUT "install_tactic.cpp" COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py" "${CMAKE_CURRENT_BINARY_DIR}" - ${_tactic_header_files} + "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps" DEPENDS "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py" ${Z3_GENERATED_FILE_EXTRA_DEPENDENCIES} - ${_tactic_header_files} + "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps" COMMENT "Generating \"${CMAKE_CURRENT_BINARY_DIR}/install_tactic.cpp\"" ${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG} VERBATIM diff --git a/scripts/mk_install_tactic_cpp.py b/scripts/mk_install_tactic_cpp.py index a152eff14..b82e71354 100755 --- a/scripts/mk_install_tactic_cpp.py +++ b/scripts/mk_install_tactic_cpp.py @@ -14,19 +14,22 @@ def main(args): logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("destination_dir", help="destination directory") - parser.add_argument("header_files", nargs="+", - help="One or more header files to parse") + parser.add_argument("deps", help="file with header file names to parse") pargs = parser.parse_args(args) if not mk_genfile_common.check_dir_exists(pargs.destination_dir): return 1 - if not mk_genfile_common.check_files_exist(pargs.header_files): + if not mk_genfile_common.check_files_exist([pargs.deps]): return 1 - h_files_full_path = [] - for header_file in pargs.header_files: - h_files_full_path.append(os.path.abspath(header_file)) + with open(pargs.deps, 'r') as f: + lines = f.read().split('\n') + h_files_full_path = [os.path.abspath(header_file) + for header_file in lines if header_file] + + if not mk_genfile_common.check_files_exist(h_files_full_path): + return 1 output = mk_genfile_common.mk_install_tactic_cpp_internal( h_files_full_path,