Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Hey, so I have this project and I'm using CMake. The thing is, I need some dependencies and I've used FetchContent to download them (here the cmake modules). Everything works fine, except when I use '/ZI' compile flag. The thing is, one dependency (Vulkan-Loader) leaks '/guard:cf' flag to the main project and doesn't compile.
cmake_minimum_required(VERSION 3.8) include(FetchContent) project(foo LANGUAGES C CXX) # Vulkan FetchContent_Declare( Vulkan-Headers GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Headers.git" GIT_TAG "sdk-1.3.216.0" ) FetchContent_MakeAvailable(Vulkan-Headers) FetchContent_Declare( Vulkan-Loader GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Loader.git" GIT_TAG "sdk-1.3.216.0" ) set(UPDATE_DEPS OFF CACHE INTERNAL "") set(BUILD_TESTS OFF CACHE INTERNAL "") FetchContent_MakeAvailable(Vulkan-Headers Vulkan-Loader) add_executable(dummy "main.cc") set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_compile_options( ${PROJECT_NAME} PRIVATE $<$: /ZI; > ) target_link_libraries( ${PROJECT_NAME} PRIVATE Vulkan::Vulkan )
cmake_minimum_required(VERSION 3.8) include(FetchContent) project(foo LANGUAGES C CXX) # Vulkan FetchContent_Declare( Vulkan-Headers GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Headers.git" GIT_TAG "sdk-1.3.216.0" ) FetchContent_MakeAvailable(Vulkan-Headers) FetchContent_Declare( Vulkan-Loader GIT_REPOSITORY "https://github.com/KhronosGroup/Vulkan-Loader.git" GIT_TAG "sdk-1.3.216.0" ) set(UPDATE_DEPS OFF CACHE INTERNAL "") set(BUILD_TESTS OFF CACHE INTERNAL "") FetchContent_MakeAvailable(Vulkan-Headers Vulkan-Loader) add_executable(dummy "main.cc") set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_compile_options( ${PROJECT_NAME} PRIVATE $<$: /ZI; > ) target_link_libraries( ${PROJECT_NAME} PRIVATE Vulkan::Vulkan )