File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,37 @@ project(ddbc_bindings)
55set (CMAKE_CXX_STANDARD 17)
66set (CMAKE_CXX_STANDARD_REQUIRED ON )
77
8+ # Enable verbose output to see actual compiler/linker commands
9+ set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose output" FORCE)
10+
811if (MSVC )
12+ # Security compiler options for OneBranch compliance
13+ message (STATUS "Applying MSVC security compiler options for OneBranch compliance" )
14+
15+ add_compile_options (
16+ /GS # Buffer security check - detects buffer overruns
17+ /guard:cf # Control Flow Guard - protects against control flow hijacking
18+ )
19+
20+ add_link_options (
21+ /DYNAMICBASE # ASLR - Address Space Layout Randomization
22+ /NXCOMPAT # DEP - Data Execution Prevention
23+ /GUARD:CF # Control Flow Guard (linker)
24+ )
25+
26+ # SAFESEH only for x86 (32-bit) builds
27+ if (CMAKE_SIZEOF_VOID_P EQUAL 4) # 32-bit
28+ message (STATUS "Applying /SAFESEH for 32-bit build" )
29+ add_link_options (/SAFESEH) # Safe Structured Exception Handling
30+ else ()
31+ message (STATUS "Skipping /SAFESEH (not applicable for 64-bit builds)" )
32+ endif ()
33+
934 # Enable PDB generation for all target types
1035 add_compile_options ("$<$<CONFIG:Release>:/Zi>" )
1136 add_link_options ("$<$<CONFIG:Release>:/DEBUG /OPT:REF /OPT:ICF>" )
37+
38+ message (STATUS "Security flags applied: /GS /guard:cf /DYNAMICBASE /NXCOMPAT /GUARD:CF" )
1239endif ()
1340
1441# Detect platform
You can’t perform that action at this time.
0 commit comments