Правка установка флагов компиляции
This commit is contained in:
parent
b5ed0303a1
commit
cebdb82bfa
@ -24,37 +24,34 @@ endif()
|
|||||||
if(CMAKE_BUILD_TYPE STREQUAL Profile)
|
if(CMAKE_BUILD_TYPE STREQUAL Profile)
|
||||||
# Ключи компиляции для режима профилирования в зависимости от типа компилятора
|
# Ключи компиляции для режима профилирования в зависимости от типа компилятора
|
||||||
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
||||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
|
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "")
|
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -pg" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
set(CMAKE_STATIC_LINKER_FLAGS_PROFILE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "")
|
set(CMAKE_MODULE_LINKER_FLAGS_PROFILE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -pg" CACHE STRING "" FORCE)
|
||||||
elseif(CMAKE_CXX_COMPILER_IS_Intel)
|
elseif(CMAKE_CXX_COMPILER_IS_Intel)
|
||||||
message("Set options for profiling with Intel C++")
|
message("Set options for profiling with Intel C++")
|
||||||
elseif(CMAKE_CXX_COMPILER_IS_MSVC)
|
elseif(CMAKE_CXX_COMPILER_IS_MSVC)
|
||||||
message("Set options for profiling with Visual Studio C++")
|
message("Set options for profiling with Visual Studio C++")
|
||||||
endif()
|
endif()
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable generation of verbose build scripts." FORCE)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable generation of compile_commands.json." FORCE)
|
||||||
set(PROFILE 1)
|
set(PROFILE 1)
|
||||||
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
# В режиме отладки подробный вывод сообщений компилятора
|
# В режиме отладки подробный вывод сообщений компилятора
|
||||||
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
if(CMAKE_CXX_COMPILER_IS_Clang OR CMAKE_CXX_COMPILER_IS_GCC)
|
||||||
string(APPEND CMAKE_C_FLAGS_DEBUG " -ggdb")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb" CACHE STRING "" FORCE)
|
||||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -ggdb")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb" CACHE STRING "" FORCE)
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose build file generation." FORCE)
|
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable generation of verbose build scripts." FORCE)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable output of compile commands during generation."
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable generation of compile_commands.json." FORCE)
|
||||||
FORCE)
|
|
||||||
set(DEBUG 1)
|
set(DEBUG 1)
|
||||||
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
|
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
set(RELEASE 1)
|
set(RELEASE 1)
|
||||||
elseif(CMAKE_BUILD_TYPE STREQUAL None)
|
elseif(CMAKE_BUILD_TYPE STREQUAL None)
|
||||||
# Режим None используется для статического анализа кода
|
# Режим None используется для статического анализа кода
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable generation of verbose build scripts." FORCE)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable generation of compile_commands.json." FORCE)
|
||||||
set(ANALYSIS 1)
|
set(ANALYSIS 1)
|
||||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose build file generation." FORCE)
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable output of compile commands during generation."
|
|
||||||
FORCE)
|
|
||||||
# set(USE_CLANG_TIDY ON CACHE BOOL "Use clang-tidy")
|
|
||||||
# set(USE_CPPCHECK ON CACHE BOOL "Use cppcheck")
|
|
||||||
set(USE_PVS_STUDIO ON CACHE BOOL "Use PVS-Studio")
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user