Fix MSVC PDBs and permit them to be disabled if required (#5710)
* Revert "Remove /Zi compiler flag for MSVC, release config"
This reverts commit 9e1de3ec6e
.
* Allow MSVC PDB creation to be disabled
Turn off ASSIMP_INSTALL_PDB to disable PDB creation
* Whitespace cleanup
Assimp uses spaces in cmakelists, not tabs
---------
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
pull/5709/head^2
parent
d41b6b253d
commit
afe06f2298
|
@ -154,7 +154,7 @@ IF (WIN32)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
OPTION( ASSIMP_INSTALL_PDB
|
OPTION( ASSIMP_INSTALL_PDB
|
||||||
"Install MSVC debug files."
|
"Create MSVC debug symbol files and add to Install target."
|
||||||
ON )
|
ON )
|
||||||
IF(NOT (MSVC_VERSION LESS 1900))
|
IF(NOT (MSVC_VERSION LESS 1900))
|
||||||
# Multibyte character set has been deprecated since at least MSVC2015 (possibly earlier)
|
# Multibyte character set has been deprecated since at least MSVC2015 (possibly earlier)
|
||||||
|
@ -299,8 +299,13 @@ ELSEIF(MSVC)
|
||||||
# supress warning for double to float conversion if Double precision is activated
|
# supress warning for double to float conversion if Double precision is activated
|
||||||
ADD_COMPILE_OPTIONS(/wd4244)
|
ADD_COMPILE_OPTIONS(/wd4244)
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
# Allow user to disable PDBs
|
||||||
|
if(ASSIMP_INSTALL_PDB)
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||||
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
|
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG:FULL /PDBALTPATH:%_PDB% /OPT:REF /OPT:ICF")
|
||||||
|
elseif((GENERATOR_IS_MULTI_CONFIG) OR (CMAKE_BUILD_TYPE MATCHES Release))
|
||||||
|
message("-- MSVC PDB generation disabled. Release binary will not be debuggable.")
|
||||||
|
endif()
|
||||||
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
IF(NOT ASSIMP_HUNTER_ENABLED)
|
IF(NOT ASSIMP_HUNTER_ENABLED)
|
||||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
Loading…
Reference in New Issue