diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-26 06:45:11 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-26 06:45:11 +0000 |
commit | 641cec2f8221a911e2a8ad215b085f1e78eb04f6 (patch) | |
tree | 1a5132b2691a259b266d45d318efc7baa96f5483 /CMakeLists.txt | |
parent | 53c3f9fc6576668d0479016eca1077122a02c4b4 (diff) |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5662d1bf4b..8190203dc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) |