22
33cmake_minimum_required (VERSION 3.4.3)
44
5- if (POLICY CMP0022)
6- cmake_policy (SET CMP0022 NEW) # automatic when 2.8.12 is required
7- endif ()
5+ cmake_policy (SET CMP0022 NEW)
86
9- if (POLICY CMP0051)
10- # CMake 3.1 and higher include generator expressions of the form
11- # $<TARGETLIB:obj> in the SOURCES property. These need to be
12- # stripped everywhere that access the SOURCES property, so we just
13- # defer to the OLD behavior of not including generator expressions
14- # in the output for now.
15- cmake_policy (SET CMP0051 OLD)
16- endif ()
7+ cmake_policy (SET CMP0048 NEW)
178
18- if (POLICY CMP0057)
19- cmake_policy (SET CMP0057 NEW)
20- endif ()
9+ # CMake 3.1 and higher include generator expressions of the form
10+ # $<TARGETLIB:obj> in the SOURCES property. These need to be
11+ # stripped everywhere that access the SOURCES property, so we just
12+ # defer to the OLD behavior of not including generator expressions
13+ # in the output for now.
14+ cmake_policy (SET CMP0051 OLD)
15+
16+ cmake_policy (SET CMP0056 NEW)
17+
18+ cmake_policy (SET CMP0057 NEW)
2119
2220if (NOT DEFINED LLVM_VERSION_MAJOR)
2321 set (LLVM_VERSION_MAJOR 6)
@@ -32,13 +30,6 @@ if(NOT DEFINED LLVM_VERSION_SUFFIX)
3230 set (LLVM_VERSION_SUFFIX svn)
3331endif ()
3432
35- if (POLICY CMP0048)
36- cmake_policy (SET CMP0048 NEW)
37- set (cmake_3_0_PROJ_VERSION
38- VERSION ${LLVM_VERSION_MAJOR} .${LLVM_VERSION_MINOR} .${LLVM_VERSION_PATCH} )
39- set (cmake_3_0_LANGUAGES LANGUAGES)
40- endif ()
41-
4233if (NOT PACKAGE_VERSION )
4334 set (PACKAGE_VERSION
4435 "${LLVM_VERSION_MAJOR} .${LLVM_VERSION_MINOR} .${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX} " )
@@ -52,9 +43,8 @@ if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQ
5243endif ()
5344
5445project (LLVM
55- ${cmake_3_0_PROJ_VERSION}
56- ${cmake_3_0_LANGUAGES}
57- C CXX ASM)
46+ VERSION ${LLVM_VERSION_MAJOR} .${LLVM_VERSION_MINOR} .${LLVM_VERSION_PATCH}
47+ LANGUAGES C CXX ASM)
5848
5949if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
6050 message (STATUS "No build type selected, default to Debug" )
@@ -177,6 +167,10 @@ if(LLVM_DEPENDENCY_DEBUGGING)
177167endif ()
178168
179169option (LLVM_ENABLE_DAGISEL_COV "Debug: Prints tablegen patterns that were used for selecting" OFF )
170+ option (LLVM_ENABLE_GISEL_COV "Enable collection of GlobalISel rule coverage" OFF )
171+ if (LLVM_ENABLE_GISEL_COV)
172+ set (LLVM_GISEL_COV_PREFIX "${CMAKE_BINARY_DIR} /gisel-coverage-" CACHE STRING "Provide a filename prefix to collect the GlobalISel rule coverage" )
173+ endif ()
180174
181175# Add path for custom modules
182176set (CMAKE_MODULE_PATH
@@ -189,6 +183,9 @@ set(CMAKE_MODULE_PATH
189183# for use by clang_complete, YouCompleteMe, etc.
190184set (CMAKE_EXPORT_COMPILE_COMMANDS 1)
191185
186+ option (LLVM_INSTALL_BINUTILS_SYMLINKS
187+ "Install symlinks from the binutils tool names to the corresponding LLVM tools." OFF )
188+
192189option (LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OFF )
193190
194191option (LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF )
@@ -354,7 +351,7 @@ set(LLVM_TARGET_ARCH "host"
354351
355352option (LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON )
356353
357- option (LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON )
354+ set (LLVM_ENABLE_LIBXML2 "ON" CACHE STRING " Use libxml2 if available. Can be ON, OFF, or FORCE_ON" )
358355
359356option (LLVM_ENABLE_LIBEDIT "Use libedit if available." ON )
360357
@@ -762,6 +759,7 @@ configure_file(
762759add_custom_target (srpm
763760 COMMAND cpack -G TGZ --config CPackSourceConfig.cmake -B ${LLVM_SRPM_DIR} /SOURCES
764761 COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR} ' ${LLVM_SRPM_BINARY_SPECFILE} )
762+ set_target_properties (srpm PROPERTIES FOLDER "Misc" )
765763
766764
767765# They are not referenced. See set_output_directory().
@@ -974,6 +972,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
974972 # Installing the headers needs to depend on generating any public
975973 # tablegen'd headers.
976974 add_custom_target (llvm-headers DEPENDS intrinsics_gen)
975+ set_target_properties (llvm-headers PROPERTIES FOLDER "Misc" )
977976
978977 if (NOT CMAKE_CONFIGURATION_TYPES )
979978 add_custom_target (install -llvm-headers
@@ -997,13 +996,13 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
997996 if (TARGET ${target} )
998997 add_dependencies (distribution ${target} )
999998 else ()
1000- message (FATAL_ERROR "Specified distribution component '${target} ' doesn't have a target" )
999+ message (SEND_ERROR "Specified distribution component '${target} ' doesn't have a target" )
10011000 endif ()
10021001
10031002 if (TARGET install -${target} )
10041003 add_dependencies (install -distribution install -${target} )
10051004 else ()
1006- message (FATAL_ERROR "Specified distribution component '${target} ' doesn't have an install target" )
1005+ message (SEND_ERROR "Specified distribution component '${target} ' doesn't have an install target" )
10071006 endif ()
10081007 endforeach ()
10091008endif ()
0 commit comments