Files
CMake/Tests/RunCMake/VS10Project/VsControlFlowGuardLinkSetting.cmake
Benjamin Sluis 9e24437c91 VS: Remove the '/guard:cf' flag from v143 link flag table
Apply the change from commit db35e3cfd6 (VS: Fix support for '/guard:cf'
linker flag for v142, 2019-01-24, v3.14.0-rc1~74^2~2) to the v143 flag
table.

The entry for `LinkControlFlowGuard` in `v143_Link.json` does not work
when used in a `.vcxproj` file.  Drop our link flag table entries for
this toolset so that the flag will be passed via `AdditionalOptions`.

Also add a test case.
2022-01-12 16:45:07 -05:00

8 lines
218 B
CMake

enable_language(CXX)
# Add the Control Flow Guard compiler and linker option
add_compile_options("/guard:cf")
string(APPEND CMAKE_SHARED_LINKER_FLAGS " /guard:cf")
add_library(ControlFlowGuardProject SHARED foo.cpp)