mirror of
https://github.com/Z3Prover/z3
synced 2025-06-13 01:16:15 +00:00
[CMake] Move CMake files into their intended location so the
`contrib/cmake/bootstrap.py` script no longer needs to be executed. The previous location of the CMake files was a compromise proposed by @agurfinkel in #461. While this has served us well (allowing progress to be made) over time limitations of this approach have appeared. The main problem is that doing many git operations (e.g. pull, rebase) means the CMake files don't get updated unless the user remembers to run the script. This can lead to broken and confusing build system behaviour. This commit only does the file moving and necessary changes to `.gitignore`. Other changes will be done in subsequent commits.
This commit is contained in:
parent
f0fa439c48
commit
4b517b96df
97 changed files with 0 additions and 11 deletions
22
cmake/target_arch_detect.cmake
Normal file
22
cmake/target_arch_detect.cmake
Normal file
|
@ -0,0 +1,22 @@
|
|||
###############################################################################
|
||||
# Target detection
|
||||
#
|
||||
# We abuse the compiler preprocessor to work out what target the compiler is
|
||||
# building for. The nice thing about this approach is that we'll detect the
|
||||
# right target even if we are using a cross compiler.
|
||||
###############################################################################
|
||||
function(detect_target_architecture OUTPUT_VAR)
|
||||
try_run(run_result
|
||||
compile_result
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/cmake/target_arch_detect.cpp"
|
||||
COMPILE_OUTPUT_VARIABLE compiler_output
|
||||
)
|
||||
if (compile_result)
|
||||
message(FATAL_ERROR "Expected compile to fail")
|
||||
endif()
|
||||
string(REGEX MATCH "CMAKE_TARGET_ARCH_([a-zA-Z0-9_]+)" arch "${compiler_output}")
|
||||
# Strip out prefix
|
||||
string(REPLACE "CMAKE_TARGET_ARCH_" "" arch "${arch}")
|
||||
set(${OUTPUT_VAR} "${arch}" PARENT_SCOPE)
|
||||
endfunction()
|
Loading…
Add table
Add a link
Reference in a new issue