CMake: add backward compatibility

This commit is contained in:
xoviat 2018-01-28 16:35:50 -06:00
parent 1be4a16ec6
commit 2b84c3ecbc
1 changed files with 10 additions and 6 deletions

View File

@ -2,8 +2,8 @@
## Author: Hank Anderson <hank@statease.com> ## Author: Hank Anderson <hank@statease.com>
## ##
cmake_minimum_required(VERSION 3.9) # CMP0069 NEW cmake_minimum_required(VERSION 2.8.5)
include(CheckIPOSupported)
project(OpenBLAS C ASM) project(OpenBLAS C ASM)
set(OpenBLAS_MAJOR_VERSION 0) set(OpenBLAS_MAJOR_VERSION 0)
set(OpenBLAS_MINOR_VERSION 3) set(OpenBLAS_MINOR_VERSION 3)
@ -148,10 +148,14 @@ endif()
# add objects to the openblas lib # add objects to the openblas lib
add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} ${TARGET_OBJS} ${OpenBLAS_DEF_FILE}) add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} ${TARGET_OBJS} ${OpenBLAS_DEF_FILE})
check_ipo_supported(RESULT IPO_SUPPORTED) if(POLICY CMP0990)
if(IPO_SUPPORTED) cmake_policy(SET CMP0990 NEW)
message(STATUS "Building with link-time code generation") include(CheckIPOSupported)
set_property(TARGET ${OpenBLAS_LIBNAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) check_ipo_supported(RESULT IPO_SUPPORTED)
if(IPO_SUPPORTED)
message(STATUS "Building with link-time code generation")
set_property(TARGET ${OpenBLAS_LIBNAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif() endif()
# Android needs to explicitly link against libm # Android needs to explicitly link against libm