mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 20:05:51 +00:00
Move CMakeLists.txt files (other than the one in the repository root)
and the cmake directory into a new directory ``contrib/cmake`` that mirrors the directory structure of the root. This is a comprimise between me and Christoph Wintersteiger that was suggested by Arie Gurfinkel that allows the CMake build system to live in the Z3 repository but not impact the Z3 developers that want to avoid the CMake build system. The build system will not work in its new location and a bootstrap script will soon be provided that allows a developer to copy the files back to their correct location.
This commit is contained in:
parent
d54d6b50f0
commit
a3e0eae9ec
82 changed files with 0 additions and 0 deletions
37
contrib/cmake/cmake/compiler_flags_override.cmake
Normal file
37
contrib/cmake/cmake/compiler_flags_override.cmake
Normal file
|
@ -0,0 +1,37 @@
|
|||
# This file overrides the default compiler flags for CMake's built-in
|
||||
# configurations (CMAKE_BUILD_TYPE). Most compiler flags should not be set here.
|
||||
# The main purpose is to make sure ``-DNDEBUG`` is never set by default.
|
||||
if (CMAKE_C_COMPILER_ID)
|
||||
set(_lang C)
|
||||
elseif(CMAKE_CXX_COMPILER_ID)
|
||||
set(_lang CXX)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown language")
|
||||
endif()
|
||||
|
||||
if (("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "GNU"))
|
||||
# Taken from Modules/Compiler/GNU.cmake but -DNDEBUG is removed
|
||||
set(CMAKE_${_lang}_FLAGS_INIT "")
|
||||
set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "-g -O0")
|
||||
set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "-Os")
|
||||
set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "-O3")
|
||||
set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
|
||||
# FIXME: Remove "x.." when CMP0054 is set to NEW
|
||||
elseif ("x${CMAKE_${_lang}_COMPILER_ID}" STREQUAL "xMSVC")
|
||||
set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "/MTd /Zi /Ob0 /Od /RTC1")
|
||||
set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1")
|
||||
set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "/MT /O2 /Ob2")
|
||||
set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1")
|
||||
# Override linker flags (see Windows-MSVC.cmake for CMake's defaults)
|
||||
# The stack size comes from the Python build system.
|
||||
set(_msvc_stack_size "8388608")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /INCREMENTAL:NO /STACK:${_msvc_stack_size}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /INCREMENTAL:NO /STACK:${_msvc_stack_size}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO /STACK:${_msvc_stack_size}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO /STACK:${_msvc_stack_size}")
|
||||
unset(_msvc_stack_size)
|
||||
else()
|
||||
message(FATAL_ERROR "Overrides not set for ${_lang} compiler \"${CMAKE_${_lang}_COMPILER_ID}\"")
|
||||
endif()
|
||||
|
||||
unset(_lang)
|
Loading…
Add table
Add a link
Reference in a new issue