Force CMake 3.4.3 like llvm.

This commit is contained in:
Axel Naumann 2016-06-18 16:12:04 +02:00 committed by sftnight
parent ab48904fa2
commit ec74408174

View File

@ -1,18 +1,4 @@
cmake_minimum_required(VERSION 2.8.8)
# FIXME: It may be removed when we use 2.8.12.
if(CMAKE_VERSION VERSION_LESS 2.8.12)
# Invalidate a couple of keywords.
set(cmake_2_8_12_INTERFACE)
set(cmake_2_8_12_PRIVATE)
else()
# Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries().
set(cmake_2_8_12_INTERFACE INTERFACE)
set(cmake_2_8_12_PRIVATE PRIVATE)
if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
endif()
endif()
cmake_minimum_required(VERSION 3.4.3)
# If we are not building as a part of LLVM, build Cling as an
# standalone project, using LLVM as an external library:
@ -290,7 +276,7 @@ macro(add_cling_library name)
llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
if(TARGET ${name})
target_link_libraries(${name} ${cmake_2_8_12_INTERFACE} ${LLVM_COMMON_LIBS})
target_link_libraries(${name} ${INTERFACE} ${LLVM_COMMON_LIBS})
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libcling")
install(TARGETS ${name}