target_compile_options(loader_common_options INTERFACE /WX /GR- /w34456 /w34701 /w34703 /w34057 /w34245 /guard:cf)
# Enable control flow guard
- list(APPEND CMAKE_SHARED_LINKER_FLAGS /guard:cf)
- list(APPEND CMAKE_EXE_LINKER_FLAGS /guard:cf)
+ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
+ target_link_options(loader_common_options INTERFACE "LINKER:/guard:cf")
+ else()
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+ endif()
# Prevent <windows.h> from polluting the code. guards against things like MIN and MAX
target_compile_definitions(loader_common_options INTERFACE WIN32_LEAN_AND_MEAN)
# Use GLOB_RECURSE to find all the header files and populate the vulkan.framework headers with them
# Use CONFIGURE_DEPENDS to ensure that if the header files are updated, this list is also updated
# Note: CONFIGURE_DEPENDS is a 3.12 feature - gate it for now and remove when CMake minimum version is higher
- if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
+ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
file(GLOB_RECURSE CONFIGURE_DEPENDS FRAMEWORK_HEADERS ${VulkanHeaders_INCLUDE_DIRS})
else()
file(GLOB_RECURSE FRAMEWORK_HEADERS ${VulkanHeaders_INCLUDE_DIRS})