Skip to content

Commit 5b4c3d2

Browse files
authored
Merge pull request #754 from wlemkows/ur-add-sec-flags
Add security compiler and linker flags
2 parents 333cfc2 + 6bb7b9d commit 5b4c3d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/helpers.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function(add_ur_target_compile_options name)
6666
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
6767
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
6868
)
69+
6970
if (CMAKE_BUILD_TYPE STREQUAL "Release")
7071
target_compile_definitions(${name} PRIVATE -D_FORTIFY_SOURCE=2)
7172
endif()
@@ -81,6 +82,13 @@ function(add_ur_target_compile_options name)
8182
/MP
8283
/W3
8384
/MD$<$<CONFIG:Debug>:d>
85+
/GS
86+
)
87+
add_link_options(
88+
/DYNAMICBASE
89+
/HIGHENTROPYVA
90+
/ALLOWISOLATION
91+
/NXCOMPAT
8492
)
8593

8694
if(UR_DEVELOPER_MODE)

0 commit comments

Comments
 (0)