From 0c9684c947266b9f2df9d2e5b62ab0efb3bc4bf2 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 23 Mar 2015 20:03:57 +0000 Subject: [PATCH] Raising minimum required CMake version to 2.8.12.2. This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233008 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 16 +++------------- cmake/modules/LLVM-Config.cmake | 4 ++-- lib/DebugInfo/PDB/CMakeLists.txt | 2 +- lib/ExecutionEngine/Interpreter/CMakeLists.txt | 2 +- tools/llvm-shlib/CMakeLists.txt | 2 +- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b91ba15f553..bef66ec4774 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,24 +1,14 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. -cmake_minimum_required(VERSION 2.8.8) +cmake_minimum_required(VERSION 2.8.12.2) if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "No build type selected, default to Debug") set(CMAKE_BUILD_TYPE "Debug") endif() -# 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() +if(POLICY CMP0022) + cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required endif() if (POLICY CMP0051) diff --git a/cmake/modules/LLVM-Config.cmake b/cmake/modules/LLVM-Config.cmake index b24c12989fa..bc0527f1db4 100644 --- a/cmake/modules/LLVM-Config.cmake +++ b/cmake/modules/LLVM-Config.cmake @@ -41,9 +41,9 @@ function(explicit_llvm_config executable) llvm_map_components_to_libnames(LIBRARIES ${link_components}) get_target_property(t ${executable} TYPE) if("x${t}" STREQUAL "xSTATIC_LIBRARY") - target_link_libraries(${executable} ${cmake_2_8_12_INTERFACE} ${LIBRARIES}) + target_link_libraries(${executable} INTERFACE ${LIBRARIES}) elseif("x${t}" STREQUAL "xSHARED_LIBRARY" OR "x${t}" STREQUAL "xMODULE_LIBRARY") - target_link_libraries(${executable} ${cmake_2_8_12_PRIVATE} ${LIBRARIES}) + target_link_libraries(${executable} PRIVATE ${LIBRARIES}) else() # Use plain form for legacy user. target_link_libraries(${executable} ${LIBRARIES}) diff --git a/lib/DebugInfo/PDB/CMakeLists.txt b/lib/DebugInfo/PDB/CMakeLists.txt index 87e357e2f07..ed8c67411d9 100644 --- a/lib/DebugInfo/PDB/CMakeLists.txt +++ b/lib/DebugInfo/PDB/CMakeLists.txt @@ -73,4 +73,4 @@ add_llvm_library(LLVMDebugInfoPDB ${LIBPDB_ADDITIONAL_HEADER_DIRS} ) -target_link_libraries(LLVMDebugInfoPDB ${cmake_2_8_12_INTERFACE} "${LIBPDB_ADDITIONAL_LIBRARIES}") +target_link_libraries(LLVMDebugInfoPDB INTERFACE "${LIBPDB_ADDITIONAL_LIBRARIES}") diff --git a/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/lib/ExecutionEngine/Interpreter/CMakeLists.txt index 1aac3ac7fdc..4dbc2df4c74 100644 --- a/lib/ExecutionEngine/Interpreter/CMakeLists.txt +++ b/lib/ExecutionEngine/Interpreter/CMakeLists.txt @@ -13,7 +13,7 @@ add_llvm_library(LLVMInterpreter ) if( LLVM_ENABLE_FFI ) - target_link_libraries( LLVMInterpreter ${cmake_2_8_12_PRIVATE} ${FFI_LIBRARY_PATH} ) + target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} ) endif() add_dependencies(LLVMInterpreter intrinsics_gen) diff --git a/tools/llvm-shlib/CMakeLists.txt b/tools/llvm-shlib/CMakeLists.txt index 9a8cd4ad4b8..08dafe13ae3 100644 --- a/tools/llvm-shlib/CMakeLists.txt +++ b/tools/llvm-shlib/CMakeLists.txt @@ -90,7 +90,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for el set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) endif() -target_link_libraries(LLVM ${cmake_2_8_12_PRIVATE} ${LIB_NAMES}) +target_link_libraries(LLVM PRIVATE ${LIB_NAMES}) add_dependencies(LLVM libLLVMExports) -- 2.34.1