From: Charles Giessen Date: Wed, 3 Nov 2021 20:09:50 +0000 (-0600) Subject: Move git info in CMake to loader_common_options X-Git-Tag: upstream/1.3.208~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e18c123f120d2cf44d88d0b680f133287ab5c21;p=platform%2Fupstream%2FVulkan-Loader.git Move git info in CMake to loader_common_options Make the GIT_BRANCH_NAME and GIT_TAG_INFO apart of the loader_common_options target so it doesn't apply globally to the C_FLAGS and CXX_FLAGS. Note that this commit is a part of a series of commits and is not meant to work by itself. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 03fc7c9a..bfe08902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,6 +322,10 @@ if(MSVC) string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) endif() +# DEBUG enables runtime loader ICD verification +# Add git branch and tag info in debug mode +target_compile_definitions(loader_common_options INTERFACE $<$:DEBUG;GIT_BRANCH_NAME=${GIT_BRANCH_NAME};GIT_TAG_INFO=${GIT_TAG_INFO}>) + # Optional codegen target if(PYTHONINTERP_FOUND) add_custom_target(VulkanLoader_generated_source diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 9621840b..6c31a4a1 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -43,12 +43,6 @@ if(WIN32) endif() endif() -# DEBUG enables runtime loader ICD verification -set(CMAKE_C_FLAGS_DEBUG - "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -DGIT_BRANCH_NAME=${GIT_BRANCH_NAME} -DGIT_TAG_INFO=${GIT_TAG_INFO}") -set(CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DGIT_BRANCH_NAME=${GIT_BRANCH_NAME} -DGIT_TAG_INFO=${GIT_TAG_INFO}") - if(WIN32) if(MSVC) # Use static MSVCRT libraries