Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tim-Philipp Müller
Opus
Commits
d4b8707b
Commit
d4b8707b
authored
Jul 15, 2020
by
Zeno Sebastian Endemann
Committed by
Ralph Giles
Aug 08, 2020
Browse files
CMake: Make _FORTIFY_SOURCE optional
parent
8ad827c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
d4b8707b
...
...
@@ -109,6 +109,12 @@ cmake_dependent_option(OPUS_STACK_PROTECTOR
OFF
)
add_feature_info
(
OPUS_STACK_PROTECTOR OPUS_STACK_PROTECTOR
${
OPUS_STACK_PROTECTOR_HELP_STR
}
)
if
(
NOT MSVC AND NOT MINGW
)
set
(
OPUS_FORTIFY_SOURCE_HELP_STR
"add protection against buffer overflows."
)
option
(
OPUS_FORTIFY_SOURCE
${
OPUS_FORTIFY_SOURCE_HELP_STR
}
ON
)
add_feature_info
(
OPUS_FORTIFY_SOURCE OPUS_FORTIFY_SOURCE
${
OPUS_FORTIFY_SOURCE_HELP_STR
}
)
endif
()
if
(
OPUS_CPU_X86 OR OPUS_CPU_X64
)
set
(
OPUS_X86_MAY_HAVE_SSE_HELP_STR
"does runtime check for SSE1 support."
)
cmake_dependent_option
(
OPUS_X86_MAY_HAVE_SSE
...
...
@@ -241,7 +247,7 @@ target_include_directories(
target_link_libraries
(
opus PRIVATE
${
OPUS_REQUIRED_LIBRARIES
}
)
target_compile_definitions
(
opus PRIVATE OPUS_BUILD ENABLE_HARDENING
)
if
(
NOT MSVC
)
if
(
OPUS_FORTIFY_SOURCE
)
target_compile_definitions
(
opus PRIVATE _FORTIFY_SOURCE=2
)
endif
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment