Флаги компиляции
This commit is contained in:
parent
cd3afd21c8
commit
36073091bc
@ -24,14 +24,12 @@ endif()
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Profile)
|
||||
# Ключи компиляции для режима профилирования в зависимости от типа компилятора
|
||||
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -g -p" CACHE STRING "")
|
||||
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -g -p" CACHE STRING "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -g -p" CACHE STRING "")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}" CACHE STRING "")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE
|
||||
"${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -g -p"
|
||||
CACHE STRING "")
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
|
||||
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
||||
elseif(CMAKE_CXX_COMPILER_IS_Intel)
|
||||
message("Set options for profiling with Intel C++")
|
||||
elseif(CMAKE_CXX_COMPILER_IS_MSVC)
|
||||
@ -40,6 +38,10 @@ if(CMAKE_BUILD_TYPE STREQUAL Profile)
|
||||
set(PROFILE 1)
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
# В режиме отладки подробный вывод сообщений компилятора
|
||||
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
||||
string(APPEND CMAKE_C_FLAGS_DEBUG " -ggdb")
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -ggdb")
|
||||
endif()
|
||||
set(CMAKE_VERBOSE_MAKEFILE 1)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(DEBUG 1)
|
||||
|
Loading…
Reference in New Issue
Block a user