diff options
author | Zachary Turner <zturner@google.com> | 2015-02-24 23:32:47 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-02-24 23:32:47 +0000 |
commit | af2092060cf7092f077a20e4b67214523bdb026a (patch) | |
tree | 6a24f030b68f48cc6321665586b1b0eaa600556f /CMakeLists.txt | |
parent | 0bf03cb47380bf9bea4e738b7b5f2ded56eb335b (diff) |
[CMake] Set policy CMP0051 to OLD globally.
When you use generator expressions in a library sources list,
and then later access the SOURCES property, the OLD behavior
(CMake 3.0 and earlier) would not include these expressions in
the SOURCES property. The NEW behavior (starting in CMake 3.1)
is that they do include the generator expressions in the SOURCES
property.
Differential Revision: http://reviews.llvm.org/D7870
Reviewed By: Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 27784c44892..ed7aeb026f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,15 @@ else() endif() endif() +if (POLICY CMP0051) + # CMake 3.1 and higher include generator expressions of the form + # $<TARGETLIB:obj> in the SOURCES property. These need to be + # stripped everywhere that access the SOURCES property, so we just + # defer to the OLD behavior of not including generator expressions + # in the output for now. + cmake_policy(SET CMP0051 OLD) +endif() + if(CMAKE_VERSION VERSION_LESS 3.1.20141117) set(cmake_3_2_USES_TERMINAL) else() |