Commit 9d385d3
authored
FEAT: Added Security Compiler Options in CMake (#316)
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below (e.g.
AB#37452)
For external contributors: Insert Github Issue number below (e.g. #149)
Only one reference is required - either GitHub issue OR ADO Work Item.
-->
<!-- mssql-python maintainers: ADO Work Item -->
>
[AB#40193](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/40193)
-------------------------------------------------------------------
### Summary
<!-- Insert your summary of changes below. Minimum 10 characters
required. -->
This pull request improves the build configuration for the
`mssql_python/pybind` project, focusing on security and diagnostics for
MSVC builds. The main changes enhance security compliance and provide
better visibility into the build process.
Build diagnostics:
* Enabled verbose output in CMake to show actual compiler and linker
commands by setting `CMAKE_VERBOSE_MAKEFILE` to `ON`.
Security compliance improvements (MSVC builds):
* Added security-related compiler options: `/GS` for buffer security
checks and `/guard:cf` for Control Flow Guard.
* Added security-related linker options: `/DYNAMICBASE` for ASLR,
`/NXCOMPAT` for DEP, and `/GUARD:CF` for Control Flow Guard.
* Conditionally applied `/SAFESEH` linker option for 32-bit builds to
enable Safe Structured Exception Handling; skipped for 64-bit builds.
* Added status messages to indicate when security flags are applied and
which options are enabled or skipped.1 parent 00fbc3c commit 9d385d3
1 file changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
9 | 34 | | |
10 | 35 | | |
11 | 36 | | |
| 37 | + | |
| 38 | + | |
12 | 39 | | |
13 | 40 | | |
14 | 41 | | |
| |||
0 commit comments