r202239 - [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
NAKAMURA Takumi
geek4civic at gmail.com
Tue Feb 25 22:45:11 PST 2014
Author: chapuni
Date: Wed Feb 26 00:45:11 2014
New Revision: 202239
URL: http://llvm.org/viewvc/llvm-project?rev=202239&view=rev
Log:
[CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
For now, use both keywords, INTERFACE and PRIVATE via the variable,
- ${cmake_2_8_12_INTERFACE}
- ${cmake_2_8_12_PRIVATE}
They could be cleaned up when we introduce 2.8.12.
Modified:
cfe/trunk/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=202239&r1=202238&r2=202239&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Wed Feb 26 00:45:11 2014
@@ -1,5 +1,19 @@
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()
+
# If we are not building as a part of LLVM, build Clang as an
# standalone project, using LLVM as an external library:
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
More information about the cfe-commits
mailing list