Skip to content

Commit

Permalink
Add security compiler and linker flags
Browse files Browse the repository at this point in the history
  • Loading branch information
wlemkows committed Jul 31, 2023
1 parent 333cfc2 commit 6bb7b9d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function(add_ur_target_compile_options name)
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
)

if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_definitions(${name} PRIVATE -D_FORTIFY_SOURCE=2)
endif()
Expand All @@ -81,6 +82,13 @@ function(add_ur_target_compile_options name)
/MP
/W3
/MD$<$<CONFIG:Debug>:d>
/GS
)
add_link_options(
/DYNAMICBASE
/HIGHENTROPYVA
/ALLOWISOLATION
/NXCOMPAT
)

if(UR_DEVELOPER_MODE)
Expand Down

0 comments on commit 6bb7b9d

Please sign in to comment.