mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
Merge pull request #1216 from delcypher/cmake_simpler_include_paths
Simpler include paths (fixes #534)
This commit is contained in:
commit
7861cfcef2
cmake
scripts
src
api
api_algebraic.cppapi_arith.cppapi_array.cppapi_ast.cppapi_ast_map.cppapi_ast_vector.cppapi_bv.cppapi_config_params.cppapi_context.cppapi_datalog.cppapi_datatype.cppapi_fpa.cppapi_goal.cppapi_interp.cppapi_log.cppapi_model.cppapi_numeral.cppapi_opt.cppapi_params.cppapi_parsers.cppapi_pb.cppapi_polynomial.cppapi_qe.cppapi_quant.cppapi_rcf.cppapi_seq.cppapi_solver.cppapi_stats.cppapi_tactic.cpp
cmd_context
duality
shell
|
@ -36,15 +36,8 @@ function(z3_add_component_dependencies_to_target target_name)
|
|||
# Remaing args should be component names
|
||||
set(_expanded_deps ${ARGN})
|
||||
foreach (dependency ${_expanded_deps})
|
||||
# FIXME: Adding these include paths wouldn't be necessary if the sources
|
||||
# used include paths rooted in the ``src`` directory.
|
||||
get_property(_dep_include_dirs GLOBAL PROPERTY Z3_${dependency}_INCLUDES)
|
||||
foreach (inc_dir ${_dep_include_dirs})
|
||||
target_include_directories(${target_name} PRIVATE "${inc_dir}")
|
||||
endforeach()
|
||||
unset(_dep_include_dirs)
|
||||
# Ensure this component's dependencies are built before this component.
|
||||
# This important because we might need the generated header files in
|
||||
# This is important because we might need the generated header files in
|
||||
# other components.
|
||||
add_dependencies(${target_name} ${dependency})
|
||||
endforeach()
|
||||
|
@ -214,18 +207,14 @@ macro(z3_add_component component_name)
|
|||
target_compile_options(${component_name} PRIVATE ${flag})
|
||||
endforeach()
|
||||
|
||||
# It's unfortunate that we have to manage the include directories and dependencies ourselves.
|
||||
# It's unfortunate that we have to manage dependencies ourselves.
|
||||
#
|
||||
# If we weren't building "object" libraries we could use
|
||||
# ```
|
||||
# target_include_directories(${component_name} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# target_link_libraries(${component_name} INTERFACE ${Z3_MOD_COMPONENT_DEPENDENCIES})
|
||||
# ```
|
||||
# but we can't do that with "object" libraries.
|
||||
|
||||
# Record this component's include directories
|
||||
set_property(GLOBAL PROPERTY Z3_${component_name}_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set_property(GLOBAL APPEND PROPERTY Z3_${component_name}_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set_property(GLOBAL PROPERTY Z3_${component_name}_DEPS "")
|
||||
# Record this component's dependencies
|
||||
foreach (dependency ${Z3_MOD_COMPONENT_DEPENDENCIES})
|
||||
|
@ -243,12 +232,6 @@ macro(z3_add_component component_name)
|
|||
endif()
|
||||
#message(STATUS "Component \"${component_name}\" has the following dependencies ${_expanded_deps}")
|
||||
|
||||
# For any generated header files for this component
|
||||
target_include_directories(${component_name} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# So that any generated header files can refer to source files in the component's
|
||||
# source tree
|
||||
target_include_directories(${component_name} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
# Add any extra include directories
|
||||
foreach (extra_include ${Z3_COMPONENT_EXTRA_INCLUDE_DIRS})
|
||||
target_include_directories(${component_name} PRIVATE "${extra_include}")
|
||||
|
@ -283,7 +266,6 @@ macro(z3_add_install_tactic_rule)
|
|||
endforeach()
|
||||
unset(_component_tactic_header_files)
|
||||
|
||||
list(APPEND _search_paths "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
add_custom_command(OUTPUT "install_tactic.cpp"
|
||||
COMMAND "${PYTHON_EXECUTABLE}"
|
||||
"${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py"
|
||||
|
@ -311,13 +293,6 @@ macro(z3_add_memory_initializer_rule)
|
|||
)
|
||||
endif()
|
||||
z3_expand_dependencies(_expanded_components ${ARGN})
|
||||
# Get paths to search
|
||||
set(_search_paths "")
|
||||
foreach (dependency ${_expanded_components})
|
||||
get_property(_dep_include_dirs GLOBAL PROPERTY Z3_${dependency}_INCLUDES)
|
||||
list(APPEND _search_paths ${_dep_include_dirs})
|
||||
endforeach()
|
||||
list(APPEND _search_paths "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
# Get header files that declare initializers and finalizers
|
||||
set(_mem_init_finalize_headers "")
|
||||
|
|
|
@ -1573,7 +1573,7 @@ def def_APIs(api_files):
|
|||
|
||||
def write_log_h_preamble(log_h):
|
||||
log_h.write('// Automatically generated file\n')
|
||||
log_h.write('#include\"z3.h\"\n')
|
||||
log_h.write('#include\"api/z3.h\"\n')
|
||||
log_h.write('#ifdef __GNUC__\n')
|
||||
log_h.write('#define _Z3_UNUSED __attribute__((unused))\n')
|
||||
log_h.write('#else\n')
|
||||
|
@ -1592,14 +1592,14 @@ def write_log_h_preamble(log_h):
|
|||
def write_log_c_preamble(log_c):
|
||||
log_c.write('// Automatically generated file\n')
|
||||
log_c.write('#include<iostream>\n')
|
||||
log_c.write('#include\"z3.h\"\n')
|
||||
log_c.write('#include\"api_log_macros.h\"\n')
|
||||
log_c.write('#include\"z3_logger.h\"\n')
|
||||
log_c.write('#include\"api/z3.h\"\n')
|
||||
log_c.write('#include\"api/api_log_macros.h\"\n')
|
||||
log_c.write('#include\"api/z3_logger.h\"\n')
|
||||
|
||||
def write_exe_c_preamble(exe_c):
|
||||
exe_c.write('// Automatically generated file\n')
|
||||
exe_c.write('#include\"z3.h\"\n')
|
||||
exe_c.write('#include\"z3_replayer.h\"\n')
|
||||
exe_c.write('#include\"api/z3.h\"\n')
|
||||
exe_c.write('#include\"api/z3_replayer.h\"\n')
|
||||
#
|
||||
exe_c.write('void Z3_replayer_error_handler(Z3_context ctx, Z3_error_code c) { printf("[REPLAYER ERROR HANDLER]: %s\\n", Z3_get_error_msg(ctx, c)); }\n')
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Notes:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
#include "math/polynomial/algebraic_numbers.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/array_decl_plugin.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include<iostream>
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/well_sorted.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_ast_map.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
#include "ast/ast_translation.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
#include "api/z3.h"
|
||||
#include "api/api_context.h"
|
||||
#include "ast/pp.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_util.h"
|
||||
#include "cmd_context/cmd_context.h"
|
||||
#include "util/symbol.h"
|
||||
|
|
|
@ -20,10 +20,10 @@ Revision History:
|
|||
#include<typeinfo>
|
||||
#include "api/api_context.h"
|
||||
#include "parsers/smt/smtparser.h"
|
||||
#include"version.h"
|
||||
#include "util/version.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "ast/ast_ll_pp.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/reg_decl_plugins.h"
|
||||
#include "math/realclosure/realclosure.h"
|
||||
|
|
|
@ -20,7 +20,7 @@ Revision History:
|
|||
#include "api/api_util.h"
|
||||
#include "ast/ast_pp.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_stats.h"
|
||||
#include "muz/fp/datalog_parser.h"
|
||||
#include "util/cancel_eh.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/datatype_decl_plugin.h"
|
||||
|
|
|
@ -18,7 +18,7 @@ Notes:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "ast/fpa_decl_plugin.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_goal.h"
|
||||
#include "ast/ast_translation.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include<sstream>
|
||||
#include<vector>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_tactic.h"
|
||||
#include "api/api_solver.h"
|
||||
|
|
|
@ -17,9 +17,9 @@ Revision History:
|
|||
--*/
|
||||
#include<fstream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "util/util.h"
|
||||
#include"version.h"
|
||||
#include "util/version.h"
|
||||
|
||||
std::ostream * g_z3_log = 0;
|
||||
bool g_z3_log_enabled = false;
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_model.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_stats.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
|
|
|
@ -19,7 +19,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "util/params.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "cmd_context/cmd_context.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/pb_decl_plugin.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Notes:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_polynomial.h"
|
||||
#include "api/api_ast_vector.h"
|
||||
|
|
|
@ -19,7 +19,7 @@ Notes:
|
|||
|
||||
#include <iostream>
|
||||
#include "api/z3.h"
|
||||
#include "api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "api/api_model.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "parsers/util/pattern_validation.h"
|
||||
|
|
|
@ -21,7 +21,7 @@ Notes:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "math/realclosure/realclosure.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
|
||||
--*/
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_util.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_tactic.h"
|
||||
#include "api/api_solver.h"
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_stats.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Revision History:
|
|||
--*/
|
||||
#include<iostream>
|
||||
#include "api/z3.h"
|
||||
#include"api_log_macros.h"
|
||||
#include "api/api_log_macros.h"
|
||||
#include "api/api_context.h"
|
||||
#include "api/api_tactic.h"
|
||||
#include "api/api_model.h"
|
||||
|
|
|
@ -16,7 +16,7 @@ Notes:
|
|||
|
||||
--*/
|
||||
#include "cmd_context/cmd_context.h"
|
||||
#include"version.h"
|
||||
#include "util/version.h"
|
||||
#include "ast/ast_smt_pp.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include<vector>
|
||||
#include<list>
|
||||
#include <set>
|
||||
#include"version.h"
|
||||
#include "util/version.h"
|
||||
#include<limits.h>
|
||||
|
||||
#include "interp/iz3hash.h"
|
||||
|
|
|
@ -26,7 +26,7 @@ Revision History:
|
|||
#include "shell/smtlib_frontend.h"
|
||||
#include "shell/z3_log_frontend.h"
|
||||
#include "util/warning.h"
|
||||
#include"version.h"
|
||||
#include "util/version.h"
|
||||
#include "shell/dimacs_frontend.h"
|
||||
#include "shell/datalog_frontend.h"
|
||||
#include "shell/opt_frontend.h"
|
||||
|
|
Loading…
Reference in a new issue