aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/OpusConfig.cmake10
-rw-r--r--cmake/OpusFunctions.cmake8
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)