External project leaking compile flags

This page summarizes the projects mentioned and recommended in the original post on /r/cpp_questions

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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.

  • Vulkan-Loader

    Vulkan Loader

  • 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 )

  • 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.

    WorkOS logo
  • Vulkan-Headers

    Vulkan header files and API registry

  • 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 )

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts