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.
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 $<$<CONFIG:DEBUG>: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
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