diff options
author | Marcus Asteborg <maastebo@microsoft.com> | 2020-04-27 08:52:57 -0700 |
---|---|---|
committer | Mark Harris <mark.hsj@gmail.com> | 2020-06-13 00:21:11 -0700 |
commit | c350cec965dd316f8515a8e2b619cb4da12f8825 (patch) | |
tree | 0def5fdbddf87810ea9146051f7f59611e0b195e /cmake | |
parent | d00d866e8c56d5a8acf764e34ce04dc54c790ac8 (diff) | |
download | libopus-c350cec965dd316f8515a8e2b619cb4da12f8825.tar.gz |
cmake - move all compiler feature detection to OpusConfig
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/OpusConfig.cmake | 10 | ||||
-rw-r--r-- | cmake/OpusFunctions.cmake | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/cmake/OpusConfig.cmake b/cmake/OpusConfig.cmake index 1d0dcccd..1b40fbf1 100644 --- a/cmake/OpusConfig.cmake +++ b/cmake/OpusConfig.cmake @@ -66,3 +66,13 @@ elseif(OPUS_CPU_ARM) endif() endif() endif() + +if(MSVC) + check_flag(FAST_MATH /fp:fast) + check_flag(STACK_PROTECTOR /GS) + check_flag(STACK_PROTECTOR_DISABLED /GS-) +else() + check_flag(FAST_MATH -ffast-math) + check_flag(STACK_PROTECTOR -fstack-protector-strong) + check_flag(HIDDEN_VISIBILITY -fvisibility=hidden) +endif() diff --git a/cmake/OpusFunctions.cmake b/cmake/OpusFunctions.cmake index f0da3822..2eb83f4e 100644 --- a/cmake/OpusFunctions.cmake +++ b/cmake/OpusFunctions.cmake @@ -92,14 +92,6 @@ function(get_package_version PACKAGE_VERSION) set(PACKAGE_VERSION 0 PARENT_SCOPE) endfunction() -function(check_and_set_flag NAME FLAG) - include(CheckCCompilerFlag) - check_c_compiler_flag(${FLAG} ${NAME}_SUPPORTED) - if(${NAME}_SUPPORTED) - add_definitions(${FLAG}) - endif() -endfunction() - function(check_flag NAME FLAG) include(CheckCCompilerFlag) check_c_compiler_flag(${FLAG} ${NAME}_SUPPORTED) |