From 925c34b886cf79333a39dc25f85a12a2b5775b61 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 30 Mar 2020 11:09:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B1=D0=B0=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCommon.cmake | 2 +- CMLibCommonTargetProperties.cmake | 31 +++++++++++++++++++++++++++++++ hpp/cmlib_config.hpp.in | 14 ++------------ thirdparty/sanitizers | 2 +- 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/CMLibCommon.cmake b/CMLibCommon.cmake index 21677b2..0837500 100644 --- a/CMLibCommon.cmake +++ b/CMLibCommon.cmake @@ -27,9 +27,9 @@ include(CMLibCompilerFlags) include(CMLibDistCC) include(CMLibCompilerFeaturesHPPGenerate) include(CMLibFlagRemove) +include(CMLibBuildTypes) include(CMLibCommonTargetProperties) include(CMLibCommonLibraryTarget) -include(CMLibBuildTypes) include(CMLibCodeAnalysisPvsStudio) include(CMLibCodeAnalysisClangAnalyze) include(CMLibCodeAnalysisClangTidy) diff --git a/CMLibCommonTargetProperties.cmake b/CMLibCommonTargetProperties.cmake index 46dc2d1..0750475 100644 --- a/CMLibCommonTargetProperties.cmake +++ b/CMLibCommonTargetProperties.cmake @@ -92,4 +92,35 @@ function(common_target_properties Name) endif() endif() + if(CMAKE_BUILD_TYPE STREQUAL Profile) + target_compile_definitions( + ${Name} + ${__visibility} + PROFILE=1) + elseif(CMAKE_BUILD_TYPE STREQUAL Debug) + target_compile_definitions( + ${Name} + ${__visibility} + DEBUG=1) + elseif(CMAKE_BUILD_TYPE STREQUAL Release) + target_compile_definitions( + ${Name} + ${__visibility} + RELEASE=1) + elseif(CMAKE_BUILD_TYPE STREQUAL None) + target_compile_definitions( + ${Name} + ${__visibility} + ANALYSIS=1) + endif() + + target_compile_definitions( + ${Name} + ${__visibility} + "ORGANIZATION_NAME=${CMLIB_ORGANIZATION_NAME_CANONICAL}") + target_compile_definitions( + ${Name} + ${__visibility} + "PROJECT_NAME=${CMLIB_PROJECT_NAME_CANONICAL}") + endfunction() diff --git a/hpp/cmlib_config.hpp.in b/hpp/cmlib_config.hpp.in index d180a4c..9ab763d 100644 --- a/hpp/cmlib_config.hpp.in +++ b/hpp/cmlib_config.hpp.in @@ -5,18 +5,8 @@ #define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_STR "@PROJECT_VERSION@" #define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_INT @PROJECT_VERSION_INT@ -#define ORGANIZATION_NAME "@ORGANIZATION_NAME@" -#define ORGANIZATION_NAME_LOWER "@ORGANIZATION_NAME_LOWER@" -#define ORGANIZATION_NAME_UPPER "@ORGANIZATION_NAME_UPPER@" -#define PROJECT_NAME "@CMAKE_PROJECT_NAME@" -#define PROJECT_NAME_LOWER "@CMAKE_PROJECT_NAME_LOWER@" -#define PROJECT_NAME_UPPER "@CMAKE_PROJECT_NAME_UPPER@" -#define BUILD_TYPE "@CMAKE_BUILD_TYPE@" -#define BUILD_DATE "@TODAY@" -#cmakedefine PROFILE @PROFILE@ -#cmakedefine DEBUG @DEBUG@ -#cmakedefine RELEASE @RELEASE@ -#cmakedefine ANALYSIS @ANALYSIS@ +#define @CMLIB_PROJECT_NAME_CANONICAL@_BUILD_TYPE "@CMAKE_BUILD_TYPE@" +#define @CMLIB_PROJECT_NAME_CANONICAL@_BUILD_DATE "@TODAY@" #cmakedefine _LARGEFILE_SOURCE #cmakedefine _LARGE_FILES diff --git a/thirdparty/sanitizers b/thirdparty/sanitizers index 26eced8..dfa7faf 160000 --- a/thirdparty/sanitizers +++ b/thirdparty/sanitizers @@ -1 +1 @@ -Subproject commit 26eced86d8e759c625b697f6b0588d7a28746725 +Subproject commit dfa7faf459634501a7b76944ad264d5959f14615