summaryrefslogtreecommitdiff
path: root/sci-mathematics/flint/files/flint-2.9.0-remove-hardcoded-CFLAGS.patch
blob: b057ea207bbd5e10fbeb69d13b0021aba8366f46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9784633c4..641ab9ed4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
 cmake_minimum_required(VERSION 3.9)
 
-include(CheckIPOSupported)
 include(CheckIncludeFiles)
 include(CheckFunctionExists)
 include(CheckPrototypeDefinition)
@@ -126,13 +125,6 @@ with open(join('${CMAKE_SOURCE_DIR}','qadic', 'CPimport.txt')) as fin:
 )
 configure_file(${CMAKE_BINARY_DIR}/CPimport.h.in ${CMAKE_BINARY_DIR}/CPimport.h COPYONLY)
 
-# Setup for flint-config.h
-check_c_compiler_flag("-mpopcnt" HAS_FLAG_MPOPCNT)
-check_c_compiler_flag("-funroll-loops" HAS_FLAG_UNROLL_LOOPS)
-
-if(HAS_FLAG_MPOPCNT)
-  set(CMAKE_REQUIRED_FLAGS "-mpopcnt")
-endif()
 # Testing __builtin_popcountl...
 check_c_source_runs([[int main(int argc, char ** argv) {
   #if defined(_WIN64)
@@ -141,7 +133,6 @@ check_c_source_runs([[int main(int argc, char ** argv) {
   return __builtin_popcountl(argc) == 100;
   #endif
   }]] FLINT_USES_POPCNT)
-unset(CMAKE_REQUIRED_FLAGS)
 
 # fenv configuration
 check_c_source_compiles([[#include <fenv.h>
@@ -250,13 +241,6 @@ if(BUILD_SHARED_LIBS AND WIN32)
     target_compile_definitions(flint PUBLIC "MSC_USE_DLL")
 endif()
 
-if (HAS_FLAG_MPOPCNT)
-    target_compile_options(flint PUBLIC "-mpopcnt")
-endif()
-if (HAS_FLAG_UNROLL_LOOPS)
-    target_compile_options(flint PUBLIC "-funroll-loops")
-endif()
-
 # Versioning
 
 set_target_properties(flint PROPERTIES
@@ -279,21 +263,6 @@ elseif (WIN32)
     set_target_properties(flint PROPERTIES RUNTIME_OUTPUT_NAME "flint-${FLINT_MAJOR}")
 endif()
 
-if(NOT DEFINED IPO_SUPPORTED)
-    message(STATUS "Checking for IPO")
-    check_ipo_supported(RESULT ipo_supported LANGUAGES C)
-    if(ipo_supported)
-        message(STATUS "Checking for IPO - found")
-    else()
-        message(STATUS "Checking for IPO - not found")
-    endif()
-    set(IPO_SUPPORTED ${ipo_supported} CACHE INTERNAL "Introprocedural Optimization" FORCE)
-endif()
-
-if(IPO_SUPPORTED)
-    set_target_properties(flint PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
-endif()
-
 if(NOT MSVC)
 	target_link_libraries(flint PUBLIC m)
 endif()