Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.
Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews
D144509 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
D150532 [OpenMP] Compile assembly files as ASM, not C
Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.
Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.
Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.
D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump
The build uses other mechanism to select the runtime.
Fixes #62719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D151344
2023-05-24 18:12:32 +02:00
cmake_minimum_required ( VERSION 3.20.0 )
2024-05-25 17:16:39 +02:00
set ( LLVM_SUBPROJECT_TITLE "Clang" )
2016-03-28 18:24:22 +00:00
2022-10-24 06:31:37 +02:00
if ( NOT DEFINED LLVM_COMMON_CMAKE_UTILS )
set ( LLVM_COMMON_CMAKE_UTILS ${ CMAKE_CURRENT_SOURCE_DIR } /../cmake )
endif ( )
include ( ${ LLVM_COMMON_CMAKE_UTILS } /Modules/CMakePolicy.cmake
N O _ P O L I C Y _ S C O P E )
2016-03-28 18:24:22 +00:00
# If we are not building as a part of LLVM, build Clang as an
# standalone project, using LLVM as an external library:
2022-01-02 06:29:26 +00:00
if ( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
2016-03-28 18:24:22 +00:00
project ( Clang )
2022-01-16 06:14:24 +00:00
set ( CLANG_BUILT_STANDALONE TRUE )
endif ( )
2024-03-23 20:26:20 +01:00
# Make sure that our source directory is on the current cmake module path so that
# we can include cmake files from this directory.
list ( INSERT CMAKE_MODULE_PATH 0
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / c m a k e / m o d u l e s "
" $ { L L V M _ C O M M O N _ C M A K E _ U T I L S } / M o d u l e s "
)
2022-01-16 06:14:24 +00:00
# Must go below project(..)
include ( GNUInstallDirs )
2024-03-22 15:29:36 -07:00
include ( GetDarwinLinkerVersion )
2016-03-28 18:24:22 +00:00
2022-01-16 06:14:24 +00:00
if ( CLANG_BUILT_STANDALONE )
2022-08-05 21:45:55 +02:00
set ( CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to" )
2020-07-10 09:33:54 -07:00
set ( CMAKE_CXX_STANDARD_REQUIRED YES )
set ( CMAKE_CXX_EXTENSIONS NO )
2016-03-28 18:24:22 +00:00
if ( NOT MSVC_IDE )
set ( LLVM_ENABLE_ASSERTIONS ${ ENABLE_ASSERTIONS }
C A C H E B O O L " E n a b l e a s s e r t i o n s " )
# Assertions should follow llvm-config's.
mark_as_advanced ( LLVM_ENABLE_ASSERTIONS )
endif ( )
2021-09-16 18:27:53 +02:00
find_package ( LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}" )
2022-02-02 15:37:13 +00:00
list ( APPEND CMAKE_MODULE_PATH "${LLVM_DIR}" )
CMake: Deprecate using llvm-config to detect llvm installation
Summary:
clang currently uses llvm-config to determine the installation paths
for llvm's headers and binaries. clang is also using LLVM's cmake
files to determine other information about the LLVM build, like
LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc. Since the installation
paths are also available via the cmake files, we can simplify the code
by only relying on information from cmake about the LLVM install and
dropping the use of llvm-config altogether.
In addition to simplifying the code, the cmake files have more
accurate information about the llvm installation paths. llvm-config
assumes that the lib, bin, and cmake directories are always located
in the same place relative to the path of the llvm-config executable.
This can be wrong if a user decides to install headers, binaries
or libraries to a non-standard location: e.g. static libraries
installed to /usr/lib/llvm6.0/
This patch takes the first step towards dropping llvm-config by
removing the automatic detection of llvm-config (users can still
manually supply a path to llvm-config by passing
-DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a
deprecation warning when users try to use this option.
Reviewers: chandlerc, beanz, mgorny, chapuni
Subscribers: mehdi_amini, dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D51714
llvm-svn: 346732
2018-11-13 03:42:46 +00:00
2022-08-06 09:22:05 -04:00
# Turn into CACHE PATHs for overwritting
set ( LLVM_INCLUDE_DIRS ${ LLVM_INCLUDE_DIRS } CACHE PATH "Path to llvm/include and any other header dirs needed" )
set ( LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build tree" )
set ( LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree" )
set ( LLVM_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}" CACHE PATH "Path to llvm/bin" )
set ( LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE PATH "Path to llvm/lib" )
2016-03-28 18:24:22 +00:00
find_program ( LLVM_TABLEGEN_EXE "llvm-tblgen" ${ LLVM_TOOLS_BINARY_DIR }
N O _ D E F A U L T _ P A T H )
# They are used as destination of target generators.
set ( LLVM_RUNTIME_OUTPUT_INTDIR ${ CMAKE_BINARY_DIR } / ${ CMAKE_CFG_INTDIR } /bin )
2022-08-18 22:44:46 -04:00
set ( LLVM_LIBRARY_OUTPUT_INTDIR ${ CMAKE_BINARY_DIR } / ${ CMAKE_CFG_INTDIR } /lib ${ LLVM_LIBDIR_SUFFIX } )
2016-03-28 18:24:22 +00:00
if ( WIN32 OR CYGWIN )
# DLL platform -- put DLLs into bin.
set ( LLVM_SHLIB_OUTPUT_INTDIR ${ LLVM_RUNTIME_OUTPUT_INTDIR } )
else ( )
set ( LLVM_SHLIB_OUTPUT_INTDIR ${ LLVM_LIBRARY_OUTPUT_INTDIR } )
endif ( )
option ( LLVM_INSTALL_TOOLCHAIN_ONLY
" O n l y i n c l u d e t o o l c h a i n f i l e s i n t h e ' i n s t a l l ' t a r g e t . " O F F )
2023-05-17 10:28:58 +02:00
option ( LLVM_FORCE_USE_OLD_TOOLCHAIN
2016-03-28 18:24:22 +00:00
" S e t t o O N t o f o r c e u s i n g a n o l d , u n s u p p o r t e d h o s t t o o l c h a i n . " O F F )
option ( CLANG_ENABLE_BOOTSTRAP "Generate the clang bootstrap target" OFF )
2018-11-29 14:57:14 +00:00
option ( LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON )
2016-03-28 18:24:22 +00:00
include ( AddLLVM )
include ( TableGen )
include ( HandleLLVMOptions )
include ( VersionFromVCS )
2022-10-19 20:12:10 +01:00
include ( CheckAtomic )
2021-03-15 20:56:08 +01:00
include ( GetErrcMessages )
2019-10-07 18:14:56 +00:00
include ( LLVMDistributionSupport )
2016-03-28 18:24:22 +00:00
set ( PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}" )
2020-07-31 00:11:40 +02:00
set ( BUG_REPORT_URL "${LLVM_PACKAGE_BUGREPORT}" CACHE STRING
" D e f a u l t U R L w h e r e b u g r e p o r t s a r e t o b e s u b m i t t e d . " )
2016-03-28 18:24:22 +00:00
if ( NOT DEFINED LLVM_INCLUDE_TESTS )
set ( LLVM_INCLUDE_TESTS ON )
endif ( )
2022-07-26 07:17:30 +00:00
include_directories ( ${ LLVM_INCLUDE_DIRS } )
2016-03-28 18:24:22 +00:00
link_directories ( "${LLVM_LIBRARY_DIR}" )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } /bin )
2022-08-18 22:44:46 -04:00
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } /lib ${ LLVM_LIBDIR_SUFFIX } )
set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } /lib ${ LLVM_LIBDIR_SUFFIX } )
2016-03-28 18:24:22 +00:00
2023-06-09 07:51:40 +00:00
find_package ( Python3 ${ LLVM_MINIMUM_PYTHON_VERSION } REQUIRED
C O M P O N E N T S I n t e r p r e t e r )
2016-03-28 18:24:22 +00:00
2023-06-09 07:51:40 +00:00
if ( LLVM_INCLUDE_TESTS )
2016-03-28 18:24:22 +00:00
# Check prebuilt llvm/utils.
if ( EXISTS ${ LLVM_TOOLS_BINARY_DIR } /FileCheck ${ CMAKE_EXECUTABLE_SUFFIX }
A N D E X I S T S $ { L L V M _ T O O L S _ B I N A R Y _ D I R } / c o u n t $ { C M A K E _ E X E C U T A B L E _ S U F F I X }
A N D E X I S T S $ { L L V M _ T O O L S _ B I N A R Y _ D I R } / n o t $ { C M A K E _ E X E C U T A B L E _ S U F F I X } )
set ( LLVM_UTILS_PROVIDED ON )
endif ( )
2022-11-03 15:12:50 -07:00
# Seek installed Lit.
find_program ( LLVM_LIT
N A M E S l l v m - l i t l i t . p y l i t
P A T H S " $ { L L V M _ M A I N _ S R C _ D I R } / u t i l s / l i t "
D O C " P a t h t o l i t . p y " )
2016-03-28 18:24:22 +00:00
if ( EXISTS ${ LLVM_MAIN_SRC_DIR } /utils/lit/lit.py )
2016-10-18 17:07:30 +00:00
# Note: path not really used, except for checking if lit was found
2017-11-17 22:21:23 +00:00
if ( EXISTS ${ LLVM_MAIN_SRC_DIR } /utils/llvm-lit )
add_subdirectory ( ${ LLVM_MAIN_SRC_DIR } /utils/llvm-lit utils/llvm-lit )
endif ( )
2016-03-28 18:24:22 +00:00
if ( NOT LLVM_UTILS_PROVIDED )
add_subdirectory ( ${ LLVM_MAIN_SRC_DIR } /utils/FileCheck utils/FileCheck )
add_subdirectory ( ${ LLVM_MAIN_SRC_DIR } /utils/count utils/count )
add_subdirectory ( ${ LLVM_MAIN_SRC_DIR } /utils/not utils/not )
set ( LLVM_UTILS_PROVIDED ON )
set ( CLANG_TEST_DEPS FileCheck count not )
endif ( )
2023-03-10 18:00:06 -08:00
endif ( )
if ( NOT TARGET llvm_gtest )
message ( FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF" )
2016-03-28 18:24:22 +00:00
endif ( )
if ( LLVM_LIT )
# Define the default arguments to use with 'lit', and an option for the user
# to override.
set ( LIT_ARGS_DEFAULT "-sv" )
if ( MSVC OR XCODE )
set ( LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar" )
endif ( )
set ( LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit" )
2021-03-15 20:56:08 +01:00
get_errc_messages ( LLVM_LIT_ERRC_MESSAGES )
2016-03-28 18:24:22 +00:00
# On Win32 hosts, provide an option to specify the path to the GnuWin32 tools.
if ( WIN32 AND NOT CYGWIN )
set ( LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools" )
endif ( )
else ( )
set ( LLVM_INCLUDE_TESTS OFF )
endif ( )
2022-03-16 19:46:28 +01:00
umbrella_lit_testsuite_begin ( check-all )
endif ( ) # LLVM_INCLUDE_TESTS
2022-01-02 06:29:26 +00:00
endif ( ) # standalone
2016-03-28 18:24:22 +00:00
2022-10-25 13:22:23 -04:00
# This allows disabling clang's XML dependency even if LLVM finds libxml2.
# By default, clang depends on libxml2 if LLVM does.
option ( CLANG_ENABLE_LIBXML2 "Whether libclang may depend on libxml2"
$ { L L V M _ E N A B L E _ L I B X M L 2 } )
if ( CLANG_ENABLE_LIBXML2 )
2018-11-29 14:57:14 +00:00
# Don't look for libxml if we're using MSan, since uninstrumented third party
# code may call MSan interceptors like strlen, leading to false positives.
if ( NOT LLVM_USE_SANITIZER MATCHES "Memory.*" )
set ( LIBXML2_FOUND 0 )
find_package ( LibXml2 2.5.3 QUIET )
if ( LIBXML2_FOUND )
set ( CLANG_HAVE_LIBXML 1 )
endif ( )
2017-09-02 03:53:42 +00:00
endif ( )
2016-03-28 18:24:22 +00:00
endif ( )
2024-04-11 16:56:31 -04:00
if ( CLANG_ENABLE_CIR )
2024-04-24 22:26:40 -04:00
if ( CLANG_BUILT_STANDALONE )
message ( FATAL_ERROR
" C l a n g I R i s n o t y e t s u p p o r t e d i n t h e s t a n d a l o n e b u i l d . " )
endif ( )
2024-04-11 16:56:31 -04:00
if ( NOT "${LLVM_ENABLE_PROJECTS}" MATCHES "MLIR|mlir" )
message ( FATAL_ERROR
" C a n n o t b u i l d C l a n g I R w i t h o u t M L I R i n L L V M _ E N A B L E _ P R O J E C T S " )
endif ( )
endif ( )
2016-08-23 20:07:07 +00:00
include ( CheckIncludeFile )
check_include_file ( sys/resource.h CLANG_HAVE_RLIMITS )
2023-12-22 08:12:19 -05:00
# This check requires _GNU_SOURCE on linux
check_include_file ( dlfcn.h CLANG_HAVE_DLFCN_H )
if ( CLANG_HAVE_DLFCN_H )
include ( CheckLibraryExists )
include ( CheckSymbolExists )
check_library_exists ( dl dlopen "" HAVE_LIBDL )
if ( HAVE_LIBDL )
list ( APPEND CMAKE_REQUIRED_LIBRARIES dl )
endif ( )
list ( APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE )
check_symbol_exists ( dladdr dlfcn.h CLANG_HAVE_DLADDR )
list ( REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE )
if ( HAVE_LIBDL )
list ( REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl )
endif ( )
endif ( )
2016-03-28 18:24:22 +00:00
set ( CLANG_RESOURCE_DIR "" CACHE STRING
" R e l a t i v e d i r e c t o r y f r o m t h e C l a n g b i n a r y t o i t s r e s o u r c e f i l e s . " )
set ( C_INCLUDE_DIRS "" CACHE STRING
" C o l o n s e p a r a t e d l i s t o f d i r e c t o r i e s c l a n g w i l l s e a r c h f o r h e a d e r s . " )
2024-03-20 22:45:38 -07:00
set ( USE_DEPRECATED_GCC_INSTALL_PREFIX OFF CACHE BOOL "Temporary workaround before GCC_INSTALL_PREFIX is completely removed" )
2016-03-28 18:24:22 +00:00
set ( GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc is installed." )
2020-03-19 15:20:49 -07:00
set ( DEFAULT_SYSROOT "" CACHE STRING
2016-03-28 18:24:22 +00:00
" D e f a u l t < p a t h > t o a l l c o m p i l e r i n v o c a t i o n s f o r - - s y s r o o t = < p a t h > . " )
2024-03-20 22:45:38 -07:00
if ( GCC_INSTALL_PREFIX AND NOT USE_DEPRECATED_GCC_INSTALL_PREFIX )
message ( FATAL_ERROR "GCC_INSTALL_PREFIX is deprecated and will be removed. Use "
2024-01-10 11:01:55 -08:00
" c o n f i g u r a t i o n files ( https://clang.llvm.org/docs/UsersManual.html #configuration-files)"
" t o s p e c i f y t h e d e f a u l t - - g c c - i n s t a l l - d i r = o r - - g c c - t r i p l e = . - - g c c - t o o l c h a i n = i s d i s c o u r a g e d . "
" S e e h t t p s : / / g i t h u b . c o m / l l v m / l l v m - p r o j e c t / p u l l / 7 7 5 3 7 f o r d e t a i l . " )
endif ( )
2016-03-28 18:24:22 +00:00
2016-06-03 17:26:16 +00:00
set ( ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld" )
2020-08-02 23:05:50 -07:00
set ( ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL
2016-06-20 23:54:44 +00:00
" e n a b l e x 8 6 r e l a x r e l o c a t i o n s b y d e f a u l t " )
2022-01-27 00:49:17 +08:00
set ( PPC_LINUX_DEFAULT_IEEELONGDOUBLE OFF CACHE BOOL
" E n a b l e I E E E b i n a r y 1 2 8 a s d e f a u l t l o n g d o u b l e f o r m a t o n P o w e r P C L i n u x . " )
[Clang][Driver] Re-use the calling process instead of creating a new process for the cc1 invocation
With this patch, the clang tool will now call the -cc1 invocation directly inside the same process. Previously, the -cc1 invocation was creating, and waiting for, a new process.
This patch therefore reduces the number of created processes during a build, thus it reduces build times on platforms where process creation can be costly (Windows) and/or impacted by a antivirus.
It also makes debugging a bit easier, as there's no need to attach to the secondary -cc1 process anymore, breakpoints will be hit inside the same process.
Crashes or signaling inside the -cc1 invocation will have the same side-effect as before, and will be reported through the same means.
This behavior can be controlled at compile-time through the CLANG_SPAWN_CC1 cmake flag, which defaults to OFF. Setting it to ON will revert to the previous behavior, where any -cc1 invocation will create/fork a secondary process.
At run-time, it is also possible to tweak the CLANG_SPAWN_CC1 environment variable. Setting it and will override the compile-time setting. A value of 0 calls -cc1 inside the calling process; a value of 1 will create a secondary process, as before.
Differential Revision: https://reviews.llvm.org/D69825
2020-01-13 10:40:04 -05:00
set ( CLANG_SPAWN_CC1 OFF CACHE BOOL
" W h e t h e r c l a n g s h o u l d u s e a n e w p r o c e s s f o r t h e C C 1 i n v o c a t i o n " )
2022-04-08 23:40:18 -07:00
option ( CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON )
2021-12-14 10:08:59 -08:00
2016-12-14 16:46:50 +00:00
set ( CLANG_DEFAULT_LINKER "" CACHE STRING
" D e f a u l t l i n k e r t o use ( linker name or absolute path, empty for platform default ) " )
2016-03-28 18:24:22 +00:00
set ( CLANG_DEFAULT_CXX_STDLIB "" CACHE STRING
2016-07-27 08:15:54 +00:00
" D e f a u l t C + + s t d l i b t o use ( \"libstdc++\" or \"libc++\", empty for platform default " )
2016-03-28 18:24:22 +00:00
if ( NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR
C L A N G _ D E F A U L T _ C X X _ S T D L I B S T R E Q U A L " l i b s t d c + + " O R
C L A N G _ D E F A U L T _ C X X _ S T D L I B S T R E Q U A L " l i b c + + " ) )
2016-07-25 08:04:26 +00:00
message ( WARNING "Resetting default C++ stdlib to use platform default" )
2016-07-27 08:15:54 +00:00
set ( CLANG_DEFAULT_CXX_STDLIB "" CACHE STRING
" D e f a u l t C + + s t d l i b t o use ( \"libstdc++\" or \"libc++\", empty for platform default " FORCE )
endif ( )
set ( CLANG_DEFAULT_RTLIB "" CACHE STRING
" D e f a u l t r u n t i m e l i b r a r y t o use ( \"libgcc\" or \"compiler-rt\", empty for platform default ) " )
if ( NOT(CLANG_DEFAULT_RTLIB STREQUAL "" OR
C L A N G _ D E F A U L T _ R T L I B S T R E Q U A L " l i b g c c " O R
C L A N G _ D E F A U L T _ R T L I B S T R E Q U A L " c o m p i l e r - r t " ) )
message ( WARNING "Resetting default rtlib to use platform default" )
set ( CLANG_DEFAULT_RTLIB "" CACHE STRING
" D e f a u l t r u n t i m e l i b r a r y t o use ( \"libgcc\" or \"compiler-rt\", empty for platform default ) " F O R C E )
2016-03-28 18:24:22 +00:00
endif ( )
2019-03-19 20:01:59 +00:00
set ( CLANG_DEFAULT_UNWINDLIB "" CACHE STRING
" D e f a u l t u n w i n d l i b r a r y t o use ( \"none\" \"libgcc\" or \"libunwind\", empty to match runtime library. ) " )
if ( CLANG_DEFAULT_UNWINDLIB STREQUAL "" )
if ( CLANG_DEFAULT_RTLIB STREQUAL "libgcc" )
set ( CLANG_DEFAULT_UNWINDLIB "libgcc" CACHE STRING "" FORCE )
endif ( )
endif ( )
2019-03-25 16:38:48 +00:00
if ( NOT(CLANG_DEFAULT_UNWINDLIB STREQUAL "" OR
C L A N G _ D E F A U L T _ U N W I N D L I B S T R E Q U A L " n o n e " O R
2019-03-19 20:01:59 +00:00
C L A N G _ D E F A U L T _ U N W I N D L I B S T R E Q U A L " l i b g c c " O R
C L A N G _ D E F A U L T _ U N W I N D L I B S T R E Q U A L " l i b u n w i n d " ) )
message ( WARNING "Resetting default unwindlib to use platform default" )
set ( CLANG_DEFAULT_UNWINDLIB "" CACHE STRING
2021-03-07 14:41:04 +02:00
" D e f a u l t u n w i n d l i b r a r y t o use ( \"none\" \"libgcc\" or \"libunwind\", empty to match runtime library. ) " F O R C E )
2019-03-19 20:01:59 +00:00
endif ( )
2017-11-11 01:15:41 +00:00
set ( CLANG_DEFAULT_OBJCOPY "objcopy" CACHE STRING
" D e f a u l t o b j c o p y e x e c u t a b l e t o u s e . " )
2016-03-28 18:24:22 +00:00
set ( CLANG_DEFAULT_OPENMP_RUNTIME "libomp" CACHE STRING
" D e f a u l t O p e n M P r u n t i m e u s e d b y - f o p e n m p . " )
2020-03-30 14:11:35 -04:00
set ( CLANG_SYSTEMZ_DEFAULT_ARCH "z10" CACHE STRING "SystemZ Default Arch" )
2020-03-30 14:20:48 +02:00
2016-03-28 18:24:22 +00:00
set ( CLANG_VENDOR ${ PACKAGE_VENDOR } CACHE STRING
" V e n d o r - s p e c i f i c t e x t f o r s h o w i n g w i t h v e r s i o n i n f o r m a t i o n . " )
set ( CLANG_REPOSITORY_STRING "" CACHE STRING
" V e n d o r - s p e c i f i c t e x t f o r s h o w i n g t h e r e p o s i t o r y t h e s o u r c e i s t a k e n f r o m . " )
if ( CLANG_REPOSITORY_STRING )
add_definitions ( -DCLANG_REPOSITORY_STRING= "${CLANG_REPOSITORY_STRING}" )
endif ( )
set ( CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
" V e n d o r - s p e c i f i c u t i . " )
2018-08-20 22:50:18 +00:00
set ( CLANG_PYTHON_BINDINGS_VERSIONS "" CACHE STRING
" P y t h o n v e r s i o n s t o i n s t a l l l i b c l a n g p y t h o n b i n d i n g s f o r " )
2019-07-03 22:45:55 +00:00
set ( CLANG_LINK_CLANG_DYLIB ${ LLVM_LINK_LLVM_DYLIB } CACHE BOOL
2019-07-11 21:42:55 +00:00
" L i n k t o o l s a g a i n s t l i b c l a n g - c p p . s o " )
2019-07-03 22:45:55 +00:00
if ( NOT LLVM_LINK_LLVM_DYLIB AND CLANG_LINK_CLANG_DYLIB )
message ( FATAL_ERROR "Cannot set CLANG_LINK_CLANG_DYLIB=ON when "
" L L V M _ L I N K _ L L V M _ D Y L I B = O F F " )
endif ( )
2022-08-18 22:44:46 -04:00
# The libdir suffix must exactly match whatever LLVM's configuration used.
set ( CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" )
[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore
First of all, `LLVM_TOOLS_INSTALL_DIR` put there breaks our NixOS
builds, because `LLVM_TOOLS_INSTALL_DIR` defined the same as
`CMAKE_INSTALL_BINDIR` becomes an *absolute* path, and then when
downstream projects try to install there too this breaks because our
builds always install to fresh directories for isolation's sake.
Second of all, note that `LLVM_TOOLS_INSTALL_DIR` stands out against the
other specially crafted `LLVM_CONFIG_*` variables substituted in
`llvm/cmake/modules/LLVMConfig.cmake.in`.
@beanz added it in d0e1c2a550ef348aae036d0fe78cab6f038c420c to fix a
dangling reference in `AddLLVM`, but I am suspicious of how this
variable doesn't follow the pattern.
Those other ones are carefully made to be build-time vs install-time
variables depending on which `LLVMConfig.cmake` is being generated, are
carefully made relative as appropriate, etc. etc. For my NixOS use-case
they are also fine because they are never used as downstream install
variables, only for reading not writing.
To avoid the problems I face, and restore symmetry, I deleted the
exported and arranged to have many `${project}_TOOLS_INSTALL_DIR`s.
`AddLLVM` now instead expects each project to define its own, and they
do so based on `CMAKE_INSTALL_BINDIR`. `LLVMConfig` still exports
`LLVM_TOOLS_BINARY_DIR` which is the location for the tools defined in
the usual way, matching the other remaining exported variables.
For the `AddLLVM` changes, I tried to copy the existing pattern of
internal vs non-internal or for LLVM vs for downstream function/macro
names, but it would good to confirm I did that correctly.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D117977
2022-06-11 06:11:59 +00:00
set ( CLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
" P a t h f o r b i n a r y subdirectory ( defaults to ' ${ CMAKE_INSTALL_BINDIR } ' ) " )
mark_as_advanced ( CLANG_TOOLS_INSTALL_DIR )
2016-03-28 18:24:22 +00:00
set ( CLANG_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } )
set ( CLANG_BINARY_DIR ${ CMAKE_CURRENT_BINARY_DIR } )
if ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
2018-08-30 23:41:03 +00:00
message ( FATAL_ERROR "In-source builds are not allowed. "
" P l e a s e c r e a t e a d i r e c t o r y a n d r u n c m a k e "
2016-03-28 18:24:22 +00:00
" f r o m t h e r e , p a s s i n g t h e p a t h t o t h i s s o u r c e d i r e c t o r y a s t h e l a s t a r g u m e n t . "
" T h i s p r o c e s s c r e a t e d t h e f i l e ` C M a k e C a c h e . t x t ' a n d t h e d i r e c t o r y "
" ` C M a k e F i l e s ' . P l e a s e d e l e t e t h e m . " )
endif ( )
2016-09-20 19:09:21 +00:00
# If CLANG_VERSION_* is specified, use it, if not use LLVM_VERSION_*.
if ( NOT DEFINED CLANG_VERSION_MAJOR )
set ( CLANG_VERSION_MAJOR ${ LLVM_VERSION_MAJOR } )
endif ( )
if ( NOT DEFINED CLANG_VERSION_MINOR )
set ( CLANG_VERSION_MINOR ${ LLVM_VERSION_MINOR } )
endif ( )
if ( NOT DEFINED CLANG_VERSION_PATCHLEVEL )
set ( CLANG_VERSION_PATCHLEVEL ${ LLVM_VERSION_PATCH } )
endif ( )
2023-12-05 12:20:12 -05:00
if ( NOT DEFINED CLANG_VERSION_SUFFIX )
set ( CLANG_VERSION_SUFFIX ${ LLVM_VERSION_SUFFIX } )
endif ( )
set ( CLANG_VERSION "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}.${CLANG_VERSION_PATCHLEVEL}${CLANG_VERSION_SUFFIX}" )
2025-01-28 18:59:05 -08:00
set ( MAX_CLANG_ABI_COMPAT_VERSION "${LLVM_VERSION_MAJOR}" )
2016-03-28 18:24:22 +00:00
message ( STATUS "Clang version: ${CLANG_VERSION}" )
# Configure the Version.inc file.
configure_file (
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n c l u d e / c l a n g / B a s i c / V e r s i o n . i n c . i n
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e / c l a n g / B a s i c / V e r s i o n . i n c )
# Add appropriate flags for GCC
if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual" )
if ( NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing" )
endif ( )
# Enable -pedantic for Clang even if it's not enabled for LLVM.
if ( NOT LLVM_ENABLE_PEDANTIC )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long" )
endif ( )
2024-06-11 09:03:41 +03:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" )
endif ( )
2016-03-28 18:24:22 +00:00
endif ( )
# Determine HOST_LINK_VERSION on Darwin.
set ( HOST_LINK_VERSION )
2022-03-21 18:32:03 -07:00
if ( APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*" )
2024-03-22 15:29:36 -07:00
get_darwin_linker_version ( HOST_LINK_VERSION )
2020-08-05 14:03:12 -07:00
message ( STATUS "Host linker version: ${HOST_LINK_VERSION}" )
2016-03-28 18:24:22 +00:00
endif ( )
2016-07-09 21:58:40 +00:00
include ( AddClang )
2016-03-28 18:24:22 +00:00
set ( CMAKE_INCLUDE_CURRENT_DIR ON )
include_directories ( BEFORE
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n c l u d e
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n c l u d e
)
if ( NOT LLVM_INSTALL_TOOLCHAIN_ONLY )
install ( DIRECTORY include/clang include/clang-c
2022-01-16 06:14:24 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ I N C L U D E D I R } "
2019-03-11 18:53:57 +00:00
C O M P O N E N T c l a n g - h e a d e r s
2016-03-28 18:24:22 +00:00
F I L E S _ M A T C H I N G
P A T T E R N " * . d e f "
P A T T E R N " * . h "
P A T T E R N " c o n f i g . h " E X C L U D E
)
install ( DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /include/clang
2022-01-16 06:14:24 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ I N C L U D E D I R } "
2019-03-11 18:53:57 +00:00
C O M P O N E N T c l a n g - h e a d e r s
2016-03-28 18:24:22 +00:00
F I L E S _ M A T C H I N G
P A T T E R N " C M a k e F i l e s " E X C L U D E
P A T T E R N " * . i n c "
P A T T E R N " * . h "
)
2017-05-23 18:39:08 +00:00
2019-03-11 18:53:57 +00:00
# Installing the headers needs to depend on generating any public
# tablegen'd headers.
add_custom_target ( clang-headers DEPENDS clang-tablegen-targets )
2024-05-25 17:16:39 +02:00
set_target_properties ( clang-headers PROPERTIES FOLDER "Clang/Resources" )
2019-03-11 18:53:57 +00:00
if ( NOT LLVM_ENABLE_IDE )
add_llvm_install_targets ( install-clang-headers
D E P E N D S c l a n g - h e a d e r s
C O M P O N E N T c l a n g - h e a d e r s )
endif ( )
2019-10-04 05:43:20 +00:00
add_custom_target ( bash-autocomplete DEPENDS utils/bash-autocomplete.sh )
2024-05-25 17:16:39 +02:00
set_target_properties ( bash-autocomplete PROPERTIES FOLDER "Clang/Misc" )
2022-09-05 22:00:00 +08:00
install ( FILES utils/bash-autocomplete.sh
2022-01-16 06:14:24 +00:00
D E S T I N A T I O N " $ { C M A K E _ I N S T A L L _ D A T A D I R } / c l a n g "
2019-10-04 05:43:20 +00:00
C O M P O N E N T b a s h - a u t o c o m p l e t e )
if ( NOT LLVM_ENABLE_IDE )
add_llvm_install_targets ( install-bash-autocomplete
D E P E N D S b a s h - a u t o c o m p l e t e
C O M P O N E N T b a s h - a u t o c o m p l e t e )
endif ( )
2016-03-28 18:24:22 +00:00
endif ( )
2016-07-10 01:44:00 +00:00
option ( CLANG_BUILD_TOOLS
" B u i l d t h e C l a n g t o o l s . I f O F F , j u s t g e n e r a t e b u i l d t a r g e t s . " O N )
2022-02-11 16:42:37 -05:00
if ( LLVM_ENABLE_PLUGINS OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS )
set ( HAVE_CLANG_PLUGIN_SUPPORT ON )
else ( )
set ( HAVE_CLANG_PLUGIN_SUPPORT OFF )
endif ( )
2022-02-07 18:46:33 -05:00
CMAKE_DEPENDENT_OPTION ( CLANG_PLUGIN_SUPPORT
" B u i l d c l a n g w i t h p l u g i n s u p p o r t " O N
2022-02-11 16:42:37 -05:00
" H A V E _ C L A N G _ P L U G I N _ S U P P O R T " O F F )
2022-02-07 18:46:33 -05:00
2022-07-31 05:42:16 +09:00
# If libstdc++ is statically linked, clang-repl needs to statically link libstdc++
2022-09-23 10:08:58 +02:00
# itself, which is not possible in many platforms because of current limitations in
2022-07-31 05:42:16 +09:00
# JIT stack. (more platforms need to be supported by JITLink)
if ( NOT LLVM_STATIC_LINK_CXX_STDLIB )
set ( HAVE_CLANG_REPL_SUPPORT ON )
endif ( )
2025-01-30 05:32:25 +01:00
option ( CLANG_ENABLE_OBJC_REWRITER "Build the Objective-C rewriter tool" OFF )
2020-09-03 19:37:29 -04:00
option ( CLANG_ENABLE_STATIC_ANALYZER
" I n c l u d e s t a t i c a n a l y z e r i n c l a n g b i n a r y . " O N )
2016-03-28 18:24:22 +00:00
[analyzer] Improved cmake configuration for Z3
Summary:
Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations
were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html).
Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON.
Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7
Reviewers: NoQ, george.karpenkov, mikhail.ramalho
Reviewed By: george.karpenkov
Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus
Tags: #clang
Differential Revision: https://reviews.llvm.org/D50818
llvm-svn: 344464
2018-10-13 19:45:48 +00:00
option ( CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF )
2025-01-30 05:32:25 +01:00
if ( DEFINED CLANG_ENABLE_ARCMT )
set ( CLANG_ENABLE_OBJC_REWRITER ${ CLANG_ENABLE_ARCMT } )
message ( DEPRECATION "'CLANG_ENABLE_ARCMT' is deprecated as ARCMigrate has been removed from Clang. Please use 'CLANG_ENABLE_OBJC_REWRITER' instead to enable or disable the Objective-C rewriter." )
2016-03-28 18:24:22 +00:00
endif ( )
2022-08-25 08:35:46 +02:00
# This option is a stop-gap, we should commit to removing this as
# soon as possible. See discussion:
# https://discourse.llvm.org/t/rationale-for-removing-versioned-libclang-middle-ground-to-keep-it-behind-option/
option ( CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION
" F o r c e t h e S O V E R S I O N o f l i b c l a n g t o b e e q u a l t o C L A N G _ M A J O R " O N )
2016-03-28 18:24:22 +00:00
# Clang version information
set ( CLANG_EXECUTABLE_VERSION
Rename clang link from clang-X.Y to clang-X
Summary:
As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version.
So, instead, I propose the following:
Instead of having clang-7.0 in bin/, we will have clang-7
Since also matches was gcc is doing.
Reviewers: tstellar, dlj, dim, hans
Reviewed By: dim, hans
Subscribers: dim, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D41808
llvm-svn: 328769
2018-03-29 10:05:46 +00:00
" $ { C L A N G _ V E R S I O N _ M A J O R } " C A C H E S T R I N G
" M a j o r v e r s i o n n u m b e r t h a t w i l l b e a p p e n d e d t o t h e c l a n g e x e c u t a b l e n a m e " )
2016-03-28 18:24:22 +00:00
set ( LIBCLANG_LIBRARY_VERSION
Rename clang link from clang-X.Y to clang-X
Summary:
As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version.
So, instead, I propose the following:
Instead of having clang-7.0 in bin/, we will have clang-7
Since also matches was gcc is doing.
Reviewers: tstellar, dlj, dim, hans
Reviewed By: dim, hans
Subscribers: dim, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D41808
llvm-svn: 328769
2018-03-29 10:05:46 +00:00
" $ { C L A N G _ V E R S I O N _ M A J O R } " C A C H E S T R I N G
" M a j o r v e r s i o n n u m b e r t h a t w i l l b e a p p e n d e d t o t h e l i b c l a n g l i b r a r y " )
2016-03-28 18:24:22 +00:00
mark_as_advanced ( CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION )
option ( CLANG_INCLUDE_TESTS
" G e n e r a t e b u i l d t a r g e t s f o r t h e C l a n g u n i t t e s t s . "
$ { L L V M _ I N C L U D E _ T E S T S } )
2022-09-26 21:44:13 -05:00
option ( CLANG_ENABLE_HLSL "Include HLSL build products" Off )
# While HLSL support is experimental this should stay hidden.
mark_as_advanced ( CLANG_ENABLE_HLSL )
2016-03-28 18:24:22 +00:00
add_subdirectory ( utils/TableGen )
2022-08-08 12:40:49 +02:00
# Export CLANG_TABLEGEN_EXE for use by flang docs.
set ( CLANG_TABLEGEN_EXE "${CLANG_TABLEGEN_EXE}" CACHE INTERNAL "" )
2016-03-28 18:24:22 +00:00
add_subdirectory ( include )
# All targets below may depend on all tablegen'd files.
get_property ( CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS )
Fix missing build dependency on omp_gen.
Summary:
`include/llvm/Frontend/OpenMP/CMakeLists.txt` creates a new target
called `omp_gen` which builds the generated include file `OMP.h.inc`.
This target must therefore be a dependency of every compilation step
whose transitive #include dependencies contain `OMP.h.inc`, or else
it's possible for builds to fail if Ninja (or make or whatever)
schedules that compilation step before building `OMP.h.inc` at all.
A few of those dependencies are currently missing, which leads to
intermittent build failures, depending on the order that Ninja (or
whatever) happens to schedule its commands. As far as I can see,
compiles in `clang/lib/CodeGen`, `clang/lib/Frontend`, and
`clang/examples` all depend transitivily on `OMP.h.inc` (usually via
`clang/AST/AST.h`), but don't have the formal dependency in the ninja
graph.
Adding `omp_gen` to the dependencies of `clang-tablegen-targets` seems
to be the way to get the missing dependency into the `clang/examples`
subdirectory. This also fixes the other two clang subdirectories, as
far as I can see.
Reviewers: clementval, thakis, chandlerc, jdoerfert
Reviewed By: clementval
Subscribers: cfe-commits, jdenny, mgorny, sstefan1, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D82659
2020-07-02 09:16:13 +01:00
add_custom_target ( clang-tablegen-targets
D E P E N D S
o m p _ g e n
2023-05-10 11:48:11 -07:00
C l a n g D r i v e r O p t i o n s
Fix missing build dependency on omp_gen.
Summary:
`include/llvm/Frontend/OpenMP/CMakeLists.txt` creates a new target
called `omp_gen` which builds the generated include file `OMP.h.inc`.
This target must therefore be a dependency of every compilation step
whose transitive #include dependencies contain `OMP.h.inc`, or else
it's possible for builds to fail if Ninja (or make or whatever)
schedules that compilation step before building `OMP.h.inc` at all.
A few of those dependencies are currently missing, which leads to
intermittent build failures, depending on the order that Ninja (or
whatever) happens to schedule its commands. As far as I can see,
compiles in `clang/lib/CodeGen`, `clang/lib/Frontend`, and
`clang/examples` all depend transitivily on `OMP.h.inc` (usually via
`clang/AST/AST.h`), but don't have the formal dependency in the ninja
graph.
Adding `omp_gen` to the dependencies of `clang-tablegen-targets` seems
to be the way to get the missing dependency into the `clang/examples`
subdirectory. This also fixes the other two clang subdirectories, as
far as I can see.
Reviewers: clementval, thakis, chandlerc, jdoerfert
Reviewed By: clementval
Subscribers: cfe-commits, jdenny, mgorny, sstefan1, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D82659
2020-07-02 09:16:13 +01:00
$ { C L A N G _ T A B L E G E N _ T A R G E T S } )
2024-05-25 17:16:39 +02:00
set_target_properties ( clang-tablegen-targets PROPERTIES FOLDER "Clang/Tablegenning/Targets" )
2017-07-28 15:33:47 +00:00
list ( APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets )
2016-03-28 18:24:22 +00:00
2017-07-23 05:09:44 +00:00
# Force target to be built as soon as possible. Clang modules builds depend
# header-wise on it as they ship all headers from the umbrella folders. Building
# an entire module might include header, which depends on intrinsics_gen.
2020-07-17 16:43:05 -07:00
if ( LLVM_ENABLE_MODULES )
2017-07-23 05:09:44 +00:00
list ( APPEND LLVM_COMMON_DEPENDS intrinsics_gen )
endif ( )
2016-03-28 18:24:22 +00:00
add_subdirectory ( lib )
add_subdirectory ( tools )
add_subdirectory ( runtime )
option ( CLANG_BUILD_EXAMPLES "Build CLANG example programs by default." OFF )
add_subdirectory ( examples )
2016-12-31 05:25:52 +00:00
if ( APPLE )
# this line is needed as a cleanup to ensure that any CMakeCaches with the old
# default value get updated to the new default.
if ( CLANG_ORDER_FILE STREQUAL "" )
unset ( CLANG_ORDER_FILE CACHE )
unset ( CLANG_ORDER_FILE )
endif ( )
set ( CLANG_ORDER_FILE ${ CMAKE_CURRENT_BINARY_DIR } /clang.order CACHE FILEPATH
" O r d e r f i l e t o u s e w h e n c o m p i l i n g c l a n g i n o r d e r t o i m p r o v e s t a r t u p time ( Darwin Only - requires ld64 ) . " )
if ( NOT EXISTS ${ CLANG_ORDER_FILE } )
string ( FIND "${CLANG_ORDER_FILE}" "${CMAKE_CURRENT_BINARY_DIR}" PATH_START )
if ( PATH_START EQUAL 0 )
file ( WRITE ${ CLANG_ORDER_FILE } "\n" )
else ( )
message ( FATAL_ERROR "Specified order file '${CLANG_ORDER_FILE}' does not exist." )
endif ( )
endif ( )
endif ( )
2016-03-28 18:24:22 +00:00
if ( CLANG_INCLUDE_TESTS )
2024-05-08 07:35:47 -07:00
find_package ( Perl )
2023-03-10 18:00:06 -08:00
add_subdirectory ( unittests )
list ( APPEND CLANG_TEST_DEPS ClangUnitTests )
list ( APPEND CLANG_TEST_PARAMS
c l a n g _ u n i t _ s i t e _ c o n f i g = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / t e s t / U n i t / l i t . s i t e . c f g
)
2016-03-28 18:24:22 +00:00
add_subdirectory ( test )
2018-10-11 16:32:54 +00:00
add_subdirectory ( bindings/python/tests )
2016-03-28 18:24:22 +00:00
if ( CLANG_BUILT_STANDALONE )
2022-03-16 19:46:28 +01:00
umbrella_lit_testsuite_end ( check-all )
2016-03-28 18:24:22 +00:00
endif ( )
add_subdirectory ( utils/perf-training )
endif ( )
option ( CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."
$ { L L V M _ I N C L U D E _ D O C S } )
if ( CLANG_INCLUDE_DOCS )
add_subdirectory ( docs )
endif ( )
2019-02-15 15:59:04 +00:00
# Custom target to install all clang libraries.
add_custom_target ( clang-libraries )
2024-05-25 17:16:39 +02:00
set_target_properties ( clang-libraries PROPERTIES FOLDER "Clang/Install" )
2019-02-15 15:59:04 +00:00
2019-02-20 23:08:43 +00:00
if ( NOT LLVM_ENABLE_IDE )
2019-02-15 15:59:04 +00:00
add_llvm_install_targets ( install-clang-libraries
D E P E N D S c l a n g - l i b r a r i e s
C O M P O N E N T c l a n g - l i b r a r i e s )
endif ( )
get_property ( CLANG_LIBS GLOBAL PROPERTY CLANG_LIBS )
if ( CLANG_LIBS )
list ( REMOVE_DUPLICATES CLANG_LIBS )
foreach ( lib ${ CLANG_LIBS } )
add_dependencies ( clang-libraries ${ lib } )
2019-02-20 23:08:43 +00:00
if ( NOT LLVM_ENABLE_IDE )
2019-02-15 15:59:04 +00:00
add_dependencies ( install-clang-libraries install- ${ lib } )
2020-03-20 18:42:09 -07:00
add_dependencies ( install-clang-libraries-stripped install- ${ lib } -stripped )
2019-02-15 15:59:04 +00:00
endif ( )
endforeach ( )
endif ( )
2016-06-29 20:22:44 +00:00
add_subdirectory ( cmake/modules )
2016-03-28 18:24:22 +00:00
2016-07-25 18:54:30 +00:00
if ( CLANG_STAGE )
message ( STATUS "Setting current clang stage to: ${CLANG_STAGE}" )
endif ( )
2016-03-28 18:24:22 +00:00
if ( CLANG_ENABLE_BOOTSTRAP )
include ( ExternalProject )
2016-10-19 21:18:48 +00:00
add_custom_target ( clang-bootstrap-deps DEPENDS clang )
2016-03-28 18:24:22 +00:00
if ( NOT CLANG_STAGE )
set ( CLANG_STAGE stage1 )
endif ( )
string ( REGEX MATCH "stage([0-9]*)" MATCHED_STAGE "${CLANG_STAGE}" )
if ( MATCHED_STAGE )
if ( NOT LLVM_BUILD_INSTRUMENTED )
math ( EXPR STAGE_NUM "${CMAKE_MATCH_1} + 1" )
set ( NEXT_CLANG_STAGE stage ${ STAGE_NUM } )
else ( )
set ( NEXT_CLANG_STAGE stage ${ CMAKE_MATCH_1 } )
endif ( )
else ( )
set ( NEXT_CLANG_STAGE bootstrap )
endif ( )
if ( BOOTSTRAP_LLVM_BUILD_INSTRUMENTED )
set ( NEXT_CLANG_STAGE ${ NEXT_CLANG_STAGE } -instrumented )
endif ( )
message ( STATUS "Setting next clang stage to: ${NEXT_CLANG_STAGE}" )
2017-11-11 01:15:41 +00:00
2016-03-28 18:24:22 +00:00
set ( STAMP_DIR ${ CMAKE_CURRENT_BINARY_DIR } / ${ NEXT_CLANG_STAGE } -stamps/ )
set ( BINARY_DIR ${ CMAKE_CURRENT_BINARY_DIR } / ${ NEXT_CLANG_STAGE } -bins/ )
2017-01-18 05:41:17 +00:00
if ( BOOTSTRAP_LLVM_ENABLE_LLD )
2021-03-09 11:51:09 +01:00
# adding lld to clang-bootstrap-deps without having it enabled in
# LLVM_ENABLE_PROJECTS just generates a cryptic error message.
if ( NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS )
2021-10-06 22:37:31 +05:30
message ( FATAL_ERROR "LLD is enabled in the bootstrap build, but lld is not in LLVM_ENABLE_PROJECTS" )
2021-03-09 11:51:09 +01:00
endif ( )
2017-01-18 05:41:17 +00:00
add_dependencies ( clang-bootstrap-deps lld )
endif ( )
2023-01-30 15:43:09 -08:00
if ( WIN32 )
# Build llvm-rc and llvm-mt which are needed by the Windows build.
add_dependencies ( clang-bootstrap-deps llvm-rc )
if ( LLVM_ENABLE_LIBXML2 )
add_dependencies ( clang-bootstrap-deps llvm-mt )
endif ( )
endif ( )
2016-11-16 23:59:06 +00:00
# If the next stage is LTO we need to depend on LTO and possibly lld or LLVMgold
2016-10-19 21:18:48 +00:00
if ( BOOTSTRAP_LLVM_ENABLE_LTO OR LLVM_ENABLE_LTO AND NOT LLVM_BUILD_INSTRUMENTED )
2016-03-28 18:24:22 +00:00
if ( APPLE )
2016-11-16 23:59:06 +00:00
add_dependencies ( clang-bootstrap-deps LTO )
2016-04-27 18:52:48 +00:00
# on Darwin we need to set DARWIN_LTO_LIBRARY so that -flto will work
# using the just-built compiler, and we need to override DYLD_LIBRARY_PATH
# so that the host object file tools will use the just-built libLTO.
2016-07-25 23:48:14 +00:00
# However if System Integrity Protection is enabled the DYLD variables
# will be scrubbed from the environment of any base system commands. This
# includes /bin/sh, which ninja uses when executing build commands. To
# work around the envar being filtered away we pass it in as a CMake
# variable, and have LLVM's CMake append the envar to the archiver calls.
set ( LTO_LIBRARY -DDARWIN_LTO_LIBRARY= ${ LLVM_SHLIB_OUTPUT_INTDIR } /libLTO.dylib
- D D Y L D _ L I B R A R Y _ P A T H = $ { L L V M _ L I B R A R Y _ O U T P U T _ I N T D I R } )
2023-04-20 17:02:17 -07:00
elseif ( MSVC )
add_dependencies ( clang-bootstrap-deps llvm-lib )
set ( ${ CLANG_STAGE } _AR -DCMAKE_AR= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-lib )
2016-03-28 18:24:22 +00:00
elseif ( NOT WIN32 )
2016-11-16 23:59:06 +00:00
add_dependencies ( clang-bootstrap-deps llvm-ar llvm-ranlib )
2017-01-18 05:41:17 +00:00
if ( NOT BOOTSTRAP_LLVM_ENABLE_LLD AND LLVM_BINUTILS_INCDIR )
2016-11-16 23:59:06 +00:00
add_dependencies ( clang-bootstrap-deps LLVMgold )
endif ( )
2018-11-16 04:46:48 +00:00
set ( ${ CLANG_STAGE } _AR -DCMAKE_AR= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-ar )
set ( ${ CLANG_STAGE } _RANLIB -DCMAKE_RANLIB= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-ranlib )
2016-03-28 18:24:22 +00:00
endif ( )
endif ( )
2018-06-11 20:59:31 +00:00
if ( CLANG_BOOTSTRAP_EXTRA_DEPS )
add_dependencies ( clang-bootstrap-deps ${ CLANG_BOOTSTRAP_EXTRA_DEPS } )
endif ( )
2016-03-28 18:24:22 +00:00
add_custom_target ( ${ NEXT_CLANG_STAGE } -clear
D E P E N D S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { N E X T _ C L A N G _ S T A G E } - c l e a r e d
)
add_custom_command (
O U T P U T $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { N E X T _ C L A N G _ S T A G E } - c l e a r e d
2016-10-19 21:18:48 +00:00
D E P E N D S c l a n g - b o o t s t r a p - d e p s
2016-03-28 18:24:22 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y $ { B I N A R Y _ D I R }
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { B I N A R Y _ D I R }
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y $ { S T A M P _ D I R }
C O M M A N D $ { C M A K E _ C O M M A N D } - E m a k e _ d i r e c t o r y $ { S T A M P _ D I R }
C O M M E N T " C l o b b e r r i n g $ { N E X T _ C L A N G _ S T A G E } b u i l d a n d s t a m p d i r e c t o r i e s "
)
if ( CMAKE_VERBOSE_MAKEFILE )
set ( verbose -DCMAKE_VERBOSE_MAKEFILE=On )
endif ( )
2016-07-25 18:54:30 +00:00
set ( _BOOTSTRAP_DEFAULT_PASSTHROUGH
2016-03-28 18:24:22 +00:00
P A C K A G E _ V E R S I O N
2016-10-18 00:50:20 +00:00
P A C K A G E _ V E N D O R
2016-03-28 18:24:22 +00:00
L L V M _ V E R S I O N _ M A J O R
L L V M _ V E R S I O N _ M I N O R
L L V M _ V E R S I O N _ P A T C H
2016-09-21 20:43:43 +00:00
C L A N G _ V E R S I O N _ M A J O R
C L A N G _ V E R S I O N _ M I N O R
C L A N G _ V E R S I O N _ P A T C H L E V E L
2023-12-05 12:20:12 -05:00
C L A N G _ V E R S I O N _ S U F F I X
2020-05-29 09:13:08 +02:00
C L A N G _ V E N D O R
2016-03-28 18:24:22 +00:00
L L V M _ V E R S I O N _ S U F F I X
L L V M _ B I N U T I L S _ I N C D I R
C L A N G _ R E P O S I T O R Y _ S T R I N G
2016-10-18 00:50:20 +00:00
C M A K E _ M A K E _ P R O G R A M
2017-11-29 00:34:46 +00:00
C M A K E _ O S X _ A R C H I T E C T U R E S
2021-09-21 10:44:08 +02:00
C M A K E _ B U I L D _ T Y P E
2017-11-29 00:34:46 +00:00
L L V M _ E N A B L E _ P R O J E C T S
L L V M _ E N A B L E _ R U N T I M E S )
2016-03-28 18:24:22 +00:00
2018-06-28 18:35:25 +00:00
# We don't need to depend on compiler-rt/libcxx if we're building instrumented
2016-10-19 21:18:48 +00:00
# because the next stage will use the same compiler used to build this stage.
2018-06-28 18:35:25 +00:00
if ( NOT LLVM_BUILD_INSTRUMENTED )
if ( TARGET compiler-rt )
add_dependencies ( clang-bootstrap-deps compiler-rt )
endif ( )
if ( TARGET cxx-headers )
add_dependencies ( clang-bootstrap-deps cxx-headers )
endif ( )
2016-03-28 18:24:22 +00:00
endif ( )
2017-05-11 13:19:24 +00:00
set ( C_COMPILER "clang" )
set ( CXX_COMPILER "clang++" )
if ( WIN32 )
set ( C_COMPILER "clang-cl.exe" )
set ( CXX_COMPILER "clang-cl.exe" )
endif ( )
2016-03-28 18:24:22 +00:00
set ( COMPILER_OPTIONS
2017-05-11 13:19:24 +00:00
- D C M A K E _ C X X _ C O M P I L E R = $ { L L V M _ R U N T I M E _ O U T P U T _ I N T D I R } / $ { C X X _ C O M P I L E R }
- D C M A K E _ C _ C O M P I L E R = $ { L L V M _ R U N T I M E _ O U T P U T _ I N T D I R } / $ { C _ C O M P I L E R }
2018-01-19 18:31:12 +00:00
- D C M A K E _ A S M _ C O M P I L E R = $ { L L V M _ R U N T I M E _ O U T P U T _ I N T D I R } / $ { C _ C O M P I L E R }
- D C M A K E _ A S M _ C O M P I L E R _ I D = C l a n g )
2016-03-28 18:24:22 +00:00
2020-05-29 13:14:51 +02:00
# cmake requires CMAKE_LINKER to be specified if the compiler is MSVC-like,
# otherwise it defaults the linker to be link.exe.
if ( BOOTSTRAP_LLVM_ENABLE_LLD )
if ( ( WIN32 AND NOT BOOTSTRAP_CMAKE_SYSTEM_NAME ) OR BOOTSTRAP_CMAKE_SYSTEM_NAME STREQUAL "Windows" )
set ( ${ CLANG_STAGE } _LINKER -DCMAKE_LINKER= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /lld-link ${ CMAKE_EXECUTABLE_SUFFIX } )
endif ( )
endif ( )
2018-11-16 04:46:48 +00:00
if ( BOOTSTRAP_CMAKE_SYSTEM_NAME )
set ( ${ CLANG_STAGE } _TABLEGEN
- D L L V M _ T A B L E G E N = $ { L L V M _ R U N T I M E _ O U T P U T _ I N T D I R } / l l v m - t b l g e n
- D C L A N G _ T A B L E G E N = $ { L L V M _ R U N T I M E _ O U T P U T _ I N T D I R } / c l a n g - t b l g e n )
if ( BOOTSTRAP_CMAKE_SYSTEM_NAME STREQUAL "Linux" )
if ( BOOTSTRAP_LLVM_ENABLE_LLD )
set ( ${ CLANG_STAGE } _LINKER -DCMAKE_LINKER= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /ld.lld )
endif ( )
if ( NOT BOOTSTRAP_LLVM_ENABLE_LTO )
add_dependencies ( clang-bootstrap-deps llvm-ar llvm-ranlib )
set ( ${ CLANG_STAGE } _AR -DCMAKE_AR= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-ar )
set ( ${ CLANG_STAGE } _RANLIB -DCMAKE_RANLIB= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-ranlib )
endif ( )
add_dependencies ( clang-bootstrap-deps llvm-objcopy llvm-strip )
set ( ${ CLANG_STAGE } _OBJCOPY -DCMAKE_OBJCOPY= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-objcopy )
set ( ${ CLANG_STAGE } _STRIP -DCMAKE_STRIP= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-strip )
2021-09-24 17:56:00 -07:00
set ( ${ CLANG_STAGE } _READELF -DCMAKE_READELF= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-readelf )
2018-11-16 04:46:48 +00:00
endif ( )
endif ( )
2016-03-28 18:24:22 +00:00
if ( BOOTSTRAP_LLVM_BUILD_INSTRUMENTED )
2016-10-19 21:18:48 +00:00
add_dependencies ( clang-bootstrap-deps llvm-profdata )
2016-03-28 18:24:22 +00:00
set ( PGO_OPT -DLLVM_PROFDATA= ${ LLVM_RUNTIME_OUTPUT_INTDIR } /llvm-profdata )
endif ( )
if ( LLVM_BUILD_INSTRUMENTED )
2016-10-19 21:18:48 +00:00
add_dependencies ( clang-bootstrap-deps generate-profdata )
2016-03-28 18:24:22 +00:00
set ( PGO_OPT -DLLVM_PROFDATA_FILE= ${ CMAKE_CURRENT_BINARY_DIR } /utils/perf-training/clang.profdata )
2016-08-16 22:16:29 +00:00
# Use the current tools for LTO instead of the instrumented ones
list ( APPEND _BOOTSTRAP_DEFAULT_PASSTHROUGH
C M A K E _ C X X _ C O M P I L E R
C M A K E _ C _ C O M P I L E R
C M A K E _ A S M _ C O M P I L E R
C M A K E _ A R
C M A K E _ R A N L I B
D A R W I N _ L T O _ L I B R A R Y
D Y L D _ L I B R A R Y _ P A T H )
set ( COMPILER_OPTIONS )
set ( LTO_LIBRARY )
set ( LTO_AR )
set ( LTO_RANLIB )
2016-03-28 18:24:22 +00:00
endif ( )
2022-08-17 08:16:10 +01:00
# Populate the passthrough variables
foreach ( variableName ${ CLANG_BOOTSTRAP_PASSTHROUGH } ${ _BOOTSTRAP_DEFAULT_PASSTHROUGH } )
if ( DEFINED ${ variableName } )
if ( "${${variableName}}" STREQUAL "" )
set ( value "" )
else ( )
string ( REPLACE ";" "|" value "${${variableName}}" )
endif ( )
list ( APPEND PASSTHROUGH_VARIABLES
- D $ { v a r i a b l e N a m e } = $ { v a l u e } )
endif ( )
endforeach ( )
2016-03-28 18:24:22 +00:00
# Find all variables that start with BOOTSTRAP_ and populate a variable with
# them.
get_cmake_property ( variableNames VARIABLES )
foreach ( variableName ${ variableNames } )
if ( variableName MATCHES "^BOOTSTRAP_" )
string ( SUBSTRING ${ variableName } 10 -1 varName )
2017-12-05 00:15:20 +00:00
string ( REPLACE ";" "|" value "${${variableName}}" )
2016-03-28 18:24:22 +00:00
list ( APPEND PASSTHROUGH_VARIABLES
- D $ { v a r N a m e } = $ { v a l u e } )
endif ( )
if ( ${ variableName } AND variableName MATCHES "LLVM_EXTERNAL_.*_SOURCE_DIR" )
list ( APPEND PASSTHROUGH_VARIABLES
- D $ { v a r i a b l e N a m e } = $ { $ { v a r i a b l e N a m e } } )
endif ( )
endforeach ( )
2022-08-23 05:45:25 +01:00
# Build arguments for native tool used in CMake.
set ( build_configuration "$<CONFIG>" )
set ( build_tool_args "${LLVM_EXTERNAL_PROJECT_BUILD_TOOL_ARGS}" )
if ( NOT build_tool_args STREQUAL "" )
string ( PREPEND build_tool_args "-- " )
separate_arguments ( build_tool_args UNIX_COMMAND "${build_tool_args}" )
endif ( )
2016-03-28 18:24:22 +00:00
ExternalProject_Add ( ${ NEXT_CLANG_STAGE }
2016-10-19 21:18:48 +00:00
D E P E N D S c l a n g - b o o t s t r a p - d e p s
2016-03-28 18:24:22 +00:00
P R E F I X $ { N E X T _ C L A N G _ S T A G E }
S O U R C E _ D I R $ { C M A K E _ S O U R C E _ D I R }
S T A M P _ D I R $ { S T A M P _ D I R }
B I N A R Y _ D I R $ { B I N A R Y _ D I R }
2016-06-09 22:38:42 +00:00
E X C L U D E _ F R O M _ A L L 1
2016-03-28 18:24:22 +00:00
C M A K E _ A R G S
# We shouldn't need to set this here, but INSTALL_DIR doesn't
# seem to work, so instead I'm passing this through
- D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ I N S T A L L _ P R E F I X }
$ { P A S S T H R O U G H _ V A R I A B L E S }
2019-12-13 19:04:36 -08:00
$ { C L A N G _ B O O T S T R A P _ C M A K E _ A R G S }
2016-03-28 18:24:22 +00:00
- D C L A N G _ S T A G E = $ { N E X T _ C L A N G _ S T A G E }
$ { C O M P I L E R _ O P T I O N S }
2018-11-16 04:46:48 +00:00
$ { $ { C L A N G _ S T A G E } _ T A B L E G E N }
$ { L T O _ L I B R A R Y } $ { v e r b o s e } $ { P G O _ O P T }
$ { $ { C L A N G _ S T A G E } _ L I N K E R }
$ { $ { C L A N G _ S T A G E } _ A R }
$ { $ { C L A N G _ S T A G E } _ R A N L I B }
$ { $ { C L A N G _ S T A G E } _ O B J C O P Y }
$ { $ { C L A N G _ S T A G E } _ S T R I P }
2022-08-23 05:45:25 +01:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d $ { B I N A R Y _ D I R }
- - c o n f i g $ { b u i l d _ c o n f i g u r a t i o n }
$ { b u i l d _ t o o l _ a r g s }
2016-03-28 18:24:22 +00:00
I N S T A L L _ C O M M A N D " "
S T E P _ T A R G E T S c o n f i g u r e b u i l d
2016-06-09 22:38:42 +00:00
U S E S _ T E R M I N A L _ C O N F I G U R E 1
U S E S _ T E R M I N A L _ B U I L D 1
U S E S _ T E R M I N A L _ I N S T A L L 1
2017-12-05 00:15:20 +00:00
L I S T _ S E P A R A T O R |
2016-03-28 18:24:22 +00:00
)
# exclude really-install from main target
set_target_properties ( ${ NEXT_CLANG_STAGE } PROPERTIES _EP_really-install_EXCLUDE_FROM_MAIN On )
ExternalProject_Add_Step ( ${ NEXT_CLANG_STAGE } really-install
2016-07-25 23:48:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d < B I N A R Y _ D I R > - - t a r g e t i n s t a l l
2016-03-28 18:24:22 +00:00
C O M M E N T " P e r f o r m i n g i n s t a l l s t e p f o r ' $ { N E X T _ C L A N G _ S T A G E } ' "
D E P E N D E E S b u i l d
2016-06-09 22:38:42 +00:00
U S E S _ T E R M I N A L 1
2016-03-28 18:24:22 +00:00
)
ExternalProject_Add_StepTargets ( ${ NEXT_CLANG_STAGE } really-install )
add_custom_target ( ${ NEXT_CLANG_STAGE } -install DEPENDS ${ NEXT_CLANG_STAGE } -really-install )
if ( NOT CLANG_BOOTSTRAP_TARGETS )
set ( CLANG_BOOTSTRAP_TARGETS check-llvm check-clang check-all )
endif ( )
foreach ( target ${ CLANG_BOOTSTRAP_TARGETS } )
2021-03-25 00:16:47 -07:00
2016-03-28 18:24:22 +00:00
ExternalProject_Add_Step ( ${ NEXT_CLANG_STAGE } ${ target }
2016-07-25 23:48:14 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - - b u i l d < B I N A R Y _ D I R > - - t a r g e t $ { t a r g e t }
2016-03-28 18:24:22 +00:00
C O M M E N T " P e r f o r m i n g $ { t a r g e t } f o r ' $ { N E X T _ C L A N G _ S T A G E } ' "
D E P E N D E E S c o n f i g u r e
2024-06-10 13:01:58 -07:00
# We need to set ALWAYS to ON here, otherwise these targets won't be
# built on a second invocation of ninja. The targets have their own
# logic to determine if they should build or not so setting ALWAYS ON
# here does not mean the targets will always rebuild it just means that
# they will check their dependenices and see if they need to be built.
A L W A Y S O N
2021-03-25 00:20:01 -07:00
E X C L U D E _ F R O M _ M A I N O N
2016-06-09 22:38:42 +00:00
U S E S _ T E R M I N A L 1
2016-03-28 18:24:22 +00:00
)
if ( target MATCHES "^stage[0-9]*" )
add_custom_target ( ${ target } DEPENDS ${ NEXT_CLANG_STAGE } - ${ target } )
endif ( )
ExternalProject_Add_StepTargets ( ${ NEXT_CLANG_STAGE } ${ target } )
endforeach ( )
endif ( )
if ( LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION )
add_subdirectory ( utils/ClangVisualizers )
endif ( )
2018-06-21 21:45:24 +00:00
add_subdirectory ( utils/hmaptool )
2017-04-04 19:52:25 +00:00
2019-10-07 18:14:56 +00:00
if ( CLANG_BUILT_STANDALONE )
llvm_distribution_add_targets ( )
2020-02-16 09:31:16 +01:00
process_llvm_pass_plugins ( )
2019-10-07 18:14:56 +00:00
endif ( )
2022-08-20 11:20:12 -04:00
set ( CLANG_INSTALL_LIBDIR_BASENAME "lib${CLANG_LIBDIR_SUFFIX}" )
2017-04-04 19:52:25 +00:00
configure_file (
$ { C L A N G _ S O U R C E _ D I R } / i n c l u d e / c l a n g / C o n f i g / c o n f i g . h . c m a k e
$ { C L A N G _ B I N A R Y _ D I R } / i n c l u d e / c l a n g / C o n f i g / c o n f i g . h )