llvm.org GIT mirror llvm / 0c9684c
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 Chris Bieneman 4 years ago
5 changed file(s) with 8 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
0 # See docs/CMake.html for instructions about how to build LLVM with CMake.
11
2 cmake_minimum_required(VERSION 2.8.8)
2 cmake_minimum_required(VERSION 2.8.12.2)
33
44 if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
55 message(STATUS "No build type selected, default to Debug")
66 set(CMAKE_BUILD_TYPE "Debug")
77 endif()
88
9 # FIXME: It may be removed when we use 2.8.12.
10 if(CMAKE_VERSION VERSION_LESS 2.8.12)
11 # Invalidate a couple of keywords.
12 set(cmake_2_8_12_INTERFACE)
13 set(cmake_2_8_12_PRIVATE)
14 else()
15 # Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries().
16 set(cmake_2_8_12_INTERFACE INTERFACE)
17 set(cmake_2_8_12_PRIVATE PRIVATE)
18 if(POLICY CMP0022)
19 cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
20 endif()
9 if(POLICY CMP0022)
10 cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
2111 endif()
2212
2313 if (POLICY CMP0051)
4040 llvm_map_components_to_libnames(LIBRARIES ${link_components})
4141 get_target_property(t ${executable} TYPE)
4242 if("x${t}" STREQUAL "xSTATIC_LIBRARY")
43 target_link_libraries(${executable} ${cmake_2_8_12_INTERFACE} ${LIBRARIES})
43 target_link_libraries(${executable} INTERFACE ${LIBRARIES})
4444 elseif("x${t}" STREQUAL "xSHARED_LIBRARY" OR "x${t}" STREQUAL "xMODULE_LIBRARY")
45 target_link_libraries(${executable} ${cmake_2_8_12_PRIVATE} ${LIBRARIES})
45 target_link_libraries(${executable} PRIVATE ${LIBRARIES})
4646 else()
4747 # Use plain form for legacy user.
4848 target_link_libraries(${executable} ${LIBRARIES})
7272 ${LIBPDB_ADDITIONAL_HEADER_DIRS}
7373 )
7474
75 target_link_libraries(LLVMDebugInfoPDB ${cmake_2_8_12_INTERFACE} "${LIBPDB_ADDITIONAL_LIBRARIES}")
75 target_link_libraries(LLVMDebugInfoPDB INTERFACE "${LIBPDB_ADDITIONAL_LIBRARIES}")
1212 )
1313
1414 if( LLVM_ENABLE_FFI )
15 target_link_libraries( LLVMInterpreter ${cmake_2_8_12_PRIVATE} ${FFI_LIBRARY_PATH} )
15 target_link_libraries( LLVMInterpreter PRIVATE ${FFI_LIBRARY_PATH} )
1616 endif()
1717
1818 add_dependencies(LLVMInterpreter intrinsics_gen)
8989 set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
9090 endif()
9191
92 target_link_libraries(LLVM ${cmake_2_8_12_PRIVATE} ${LIB_NAMES})
92 target_link_libraries(LLVM PRIVATE ${LIB_NAMES})
9393
9494 add_dependencies(LLVM libLLVMExports)
9595