cmake: Remove pointless conditionals
authorJuan Ramos <juan@lunarg.com>
Wed, 1 Feb 2023 00:27:25 +0000 (17:27 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Wed, 1 Feb 2023 04:54:48 +0000 (21:54 -0700)
CMake min is now 3.17

CMakeLists.txt
loader/CMakeLists.txt

index 6b9d5dc..139b886 100644 (file)
@@ -214,12 +214,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clan
     target_compile_options(loader_common_options INTERFACE /GR- /guard:cf /wd4100 /wd4152 /wd4201)
 
     # Enable control flow guard
-    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()
+    target_link_options(loader_common_options INTERFACE "LINKER:/guard:cf")
 
     # 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)
index a68fd54..9e1279c 100644 (file)
@@ -328,13 +328,8 @@ else()
         # Build vulkan.framework
         # 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
         get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES)
-        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})
-        endif()
+        file(GLOB_RECURSE CONFIGURE_DEPENDS FRAMEWORK_HEADERS ${VulkanHeaders_INCLUDE_DIRS})
         if(BUILD_STATIC_LOADER)
             add_library(vulkan-framework STATIC ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS} ${FRAMEWORK_HEADERS})
         else()