summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2018-11-23 15:20:22 +0000
committerRuben Undheim <ruben.undheim@gmail.com>2018-12-03 19:21:47 +0100
commit8ea78c9d3b7885aa5cdaec790783c84f68bcfbc5 (patch)
treeaa3ca7f000352c9e73c503da7e45999574c518a8
parente5719f1141ecf4d64b49543b7f83e15edad72066 (diff)
Check whether code compiles instead of whether it runs
Gbp-Pq: Name 0005-Check-whether-code-compiles-instead-of-whether-it-ru.patch
-rw-r--r--cmake/modules/FindSSE.cmake11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake
index 4c9673a..16b49e8 100644
--- a/cmake/modules/FindSSE.cmake
+++ b/cmake/modules/FindSSE.cmake
@@ -3,6 +3,7 @@
#endif()
include(CheckCSourceRuns)
+include(CheckCSourceCompiles)
option(ENABLE_SSE "Enable compile-time SSE4.1 support." ON)
option(ENABLE_AVX "Enable compile-time AVX support." ON)
@@ -16,7 +17,7 @@ if (ENABLE_SSE)
#
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG )
set(CMAKE_REQUIRED_FLAGS "-msse4.1")
- check_c_source_runs("
+ check_c_source_compiles("
#include <emmintrin.h>
#include <smmintrin.h>
@@ -40,7 +41,7 @@ if (ENABLE_SSE)
#
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG )
set(CMAKE_REQUIRED_FLAGS "-mavx")
- check_c_source_runs("
+ check_c_source_compiles("
#include <immintrin.h>
int main()
{
@@ -74,7 +75,7 @@ if (ENABLE_SSE)
#
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG )
set(CMAKE_REQUIRED_FLAGS "-mavx2")
- check_c_source_runs("
+ check_c_source_compiles("
#include <immintrin.h>
int main()
{
@@ -108,7 +109,7 @@ if (ENABLE_SSE)
#
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG )
set(CMAKE_REQUIRED_FLAGS "-mfma")
- check_c_source_runs("
+ check_c_source_compiles("
#include <immintrin.h>
int main()
{
@@ -143,7 +144,7 @@ if (ENABLE_SSE)
#
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG )
set(CMAKE_REQUIRED_FLAGS "-mavx512f")
- check_c_source_runs("
+ check_c_source_compiles("
#include <immintrin.h>
int main()
{