Skip to content

Commit

Permalink
[CMake] Fully delete the deprecated LLVM_USE_CRT* (#66850)
Browse files Browse the repository at this point in the history
This has been deprecated in favor of CMake's CMAKE_MSVC_RUNTIME_LIBRARY
in c6bd873 .
Current release branch still contains it in deprecated status so no
existing end-users will be affected.
  • Loading branch information
Naville committed Sep 21, 2023
1 parent ecfdc23 commit 618e5d2
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 76 deletions.
1 change: 0 additions & 1 deletion clang/cmake/caches/CrossWinToARMLinux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "")

if(WIN32)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
endif()

# Set up RPATH for the target runtime/builtin libraries.
Expand Down
1 change: 0 additions & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ set(LLDB_ENABLE_CURSES OFF CACHE BOOL "")
set(LLDB_ENABLE_LIBEDIT OFF CACHE BOOL "")

if(WIN32)
set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
set(FUCHSIA_DISABLE_DRIVER_BUILD ON)
endif()

Expand Down
4 changes: 0 additions & 4 deletions clang/cmake/caches/Fuchsia.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ foreach(variable ${_FUCHSIA_BOOTSTRAP_PASSTHROUGH})
endif()
endforeach()

if(WIN32)
set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
endif()

set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
Expand Down
58 changes: 0 additions & 58 deletions llvm/cmake/modules/ChooseMSVCCRT.cmake

This file was deleted.

3 changes: 1 addition & 2 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ endif()
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)

if( MSVC )
include(ChooseMSVCCRT)

# Add definitions that make MSVC much less annoying.
add_compile_definitions(
Expand Down Expand Up @@ -951,7 +950,7 @@ if(LLVM_USE_SANITIZER)
endif()
# Prepare ASAN runtime if needed
if (LLVM_USE_SANITIZER MATCHES ".*Address.*")
if (${LLVM_USE_CRT_${uppercase_CMAKE_BUILD_TYPE}} MATCHES "^(MT|MTd)$")
if (${CMAKE_MSVC_RUNTIME_LIBRARY} MATCHES "^(MultiThreaded|MultiThreadedDebug)$")
append("/wholearchive:clang_rt.asan-${arch}.lib /wholearchive:clang_rt.asan_cxx-${arch}.lib"
CMAKE_EXE_LINKER_FLAGS)
append("/wholearchive:clang_rt.asan_dll_thunk-${arch}.lib"
Expand Down
5 changes: 1 addition & 4 deletions llvm/cmake/modules/LLVMConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ set(LLVM_PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@)

set(LLVM_BUILD_TYPE @CMAKE_BUILD_TYPE@)

set(LLVM_USE_CRT_DEBUG @LLVM_USE_CRT_DEBUG@)
set(LLVM_USE_CRT_MINSIZEREL @LLVM_USE_CRT_MINSIZEREL@)
set(LLVM_USE_CRT_RELEASE @LLVM_USE_CRT_RELEASE@)
set(LLVM_USE_CRT_RELWITHDEBINFO @LLVM_USE_CRT_RELWITHDEBINFO@)
set(CMAKE_MSVC_RUNTIME_LIBRARY @CMAKE_MSVC_RUNTIME_LIBRARY@)

set(LLVM_USE_SPLIT_DWARF @LLVM_USE_SPLIT_DWARF@)

Expand Down
6 changes: 0 additions & 6 deletions llvm/docs/CMake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,6 @@ enabled sub-projects. Nearly all of these variable names begin with
``LLVM_USE_SANITIZER`` contains ``Undefined``. This can be used to override
the default set of UBSan flags.

**LLVM_USE_CRT_{target}**:STRING
On Windows, tells which version of the C runtime library (CRT) should be used.
For example, -DLLVM_USE_CRT_RELEASE=MT would statically link the CRT into the
LLVM tools and library. This is deprecated; use ``CMAKE_MSVC_RUNTIME_LIBRARY``
instead.

**LLVM_USE_INTEL_JITEVENTS**:BOOL
Enable building support for Intel JIT Events API. Defaults to OFF.

Expand Down

0 comments on commit 618e5d2

Please sign in to comment.