Skip to content

[CMake]Fully delete the deprecated LLVM_USE_CRT* #66850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case here seems to lack a corresponding setting of CMAKE_MSVC_RUNTIME_LIBRARY - I guess we should add that to make this a proper no-op?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been set at Line 57?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I didn't see that one.

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 "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - we should probably set CMAKE_MSVC_RUNTIME_LIBRARY instead of just removing the setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, maybe Line57 is enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean line 91 here? Ok, that's also present elsewhere here.

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)$")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wonder how I had missed this one while doing the deprecation cleanup...

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