3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

Move where the Z3 API header files to be scanned by the Python scripts

is declared out of ``src/api/CMakeLists.txt`` and into
``src/CMakeLists.txt``. We will need this list to generate the
``api_dll.def`` module definition file for MSVC. Whilst I'm here
also fix a stray use of ``USES_TERMINAL`` in ``add_custom_command()``.
This commit is contained in:
Dan Liew 2016-03-01 10:27:39 +00:00
parent 46ac368f86
commit beb21126e2
2 changed files with 34 additions and 19 deletions

View file

@ -1,9 +1,38 @@
################################################################################
# API header files
################################################################################
# This lists the API header files that are scanned by
# some of the build rules to generate some files needed
# by the build
set(Z3_API_HEADER_FILES_TO_SCAN
z3_api.h
z3_ast_containers.h
z3_algebraic.h
z3_polynomial.h
z3_rcf.h
z3_fixedpoint.h
z3_optimization.h
z3_interp.h
z3_fpa.h
)
set(Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN "")
foreach (header_file ${Z3_API_HEADER_FILES_TO_SCAN})
set(full_path_api_header_file "${CMAKE_CURRENT_SOURCE_DIR}/api/${header_file}")
list(APPEND Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN "${full_path_api_header_file}")
if (NOT EXISTS "${full_path_api_header_file}")
message(FATAL_ERROR "API header file \"${full_path_api_header_file}\" does not exist")
endif()
endforeach()
################################################################################
# Traverse directories each adding a Z3 component
################################################################################
# I'm duplicating the order in ``mk_project.py`` for now to help us keep
# the build systems in sync.
#
# The components in these directory explicitly declare their dependencies so
# you may be able to re-order some of these directories but an error will be
# raised if you try to declare a component is depedent on another component
# raised if you try to declare a component is dependent on another component
# that has not yet been declared.
add_subdirectory(util)
add_subdirectory(math/polynomial)
@ -138,6 +167,7 @@ install(TARGETS libz3
ARCHIVE DESTINATION "${Z3_INSTALL_LIB_DIR}"
PUBLIC_HEADER DESTINATION "${Z3_INSTALL_INCLUDE_DIR}"
)
################################################################################
# Z3 executable
################################################################################

View file

@ -1,14 +1,3 @@
set(api_header_files_to_scan
z3_api.h
z3_ast_containers.h
z3_algebraic.h
z3_polynomial.h
z3_rcf.h
z3_fixedpoint.h
z3_optimization.h
z3_interp.h
z3_fpa.h
)
set(generated_files
api_commands.cpp
api_log_macros.cpp
@ -23,10 +12,6 @@ foreach (gen_file ${generated_files})
endif()
endforeach()
set(full_path_api_header_files_to_scan "")
foreach (header_file ${api_header_files_to_scan})
list(APPEND full_path_api_header_files_to_scan "${CMAKE_CURRENT_SOURCE_DIR}/${header_file}")
endforeach()
set(full_path_generated_files "")
foreach (gen_file ${generated_files})
list(APPEND full_path_generated_files "${CMAKE_CURRENT_BINARY_DIR}/${gen_file}")
@ -36,12 +21,12 @@ add_custom_command(OUTPUT ${generated_files}
COMMAND "${PYTHON_EXECUTABLE}"
"${CMAKE_SOURCE_DIR}/scripts/update_api.py"
"${CMAKE_CURRENT_BINARY_DIR}"
${full_path_api_header_files_to_scan}
${Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN}
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/update_api.py"
"${CMAKE_SOURCE_DIR}/scripts/mk_util.py"
${full_path_api_header_files_to_scan}
${Z3_FULL_PATH_API_HEADER_FILES_TO_SCAN}
COMMENT "Generating ${generated_files}"
USES_TERMINAL
${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG}
VERBATIM
)