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

Pass /RELEASE to MSVC linker

Without /RELEASE passed to MSVC linker, the checksum field in exe/dll is not calculated. When you load the exe/dll in windbg (e.g., windbg -z libz3.dll), a warning "Unable to verify checksum" will show. With /RELEASE passed to linker, the warning will be gone.
This commit is contained in:
Ben Niu 2019-07-04 08:08:32 -07:00 committed by GitHub
parent 6d244ed2aa
commit 962d0dda78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -425,6 +425,14 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
include(${PROJECT_SOURCE_DIR}/cmake/msvc_legacy_quirks.cmake)
endif()
################################################################################
# Pass /RELEASE to the linker so that checksums in PE files are calculated.
################################################################################
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
string(APPEND CMAKE_EXE_LINKER_FLAGS " /RELEASE")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " /RELEASE")
endif()
################################################################################
# Report default CMake flags
################################################################################