Skip to content

Commit 6fc7cc2

Browse files
authored
Merge pull request #20 from mjacobse/support_old_cmake_without_ipo
Allow old CMake versions without IPO support
2 parents 2f5d9de + de9601d commit 6fc7cc2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CMakeLists.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ endif()
2121
if (${CMAKE_VERSION} VERSION_GREATER "3.15.0")
2222
cmake_policy(SET CMP0091 NEW)
2323
endif()
24-
cmake_policy(SET CMP0069 NEW)
25-
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
24+
if (NOT ${CMAKE_VERSION} VERSION_LESS "3.9.0")
25+
cmake_policy(SET CMP0069 NEW)
26+
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
27+
endif()
2628
project(ASL)
2729

2830
cmake_minimum_required(VERSION 3.0)
@@ -38,7 +40,11 @@ option(BUILD_DYNRT_LIBS "Build the libraries linked against the dynamic runtime
3840
option(BUILD_MT_LIBS "Build the multithreaded library" OFF)
3941
option(BUILD_CPP "Build the cpp interface" OFF)
4042
option(BUILD_F2C "Build the f2c library" OFF)
41-
option(USE_LTO "Use link time optimization" ON)
43+
if (${CMAKE_VERSION} VERSION_LESS "3.9.0")
44+
option(USE_LTO "Use link time optimization" OFF)
45+
else()
46+
option(USE_LTO "Use link time optimization" ON)
47+
endif()
4248

4349
if(NOT BUILD_ASL_EXAMPLES)
4450
option(BUILD_ASL_EXAMPLES "Build the examples" OFF)

0 commit comments

Comments
 (0)