mirror-llvm-project/clang/cmake/modules
Haowei a04f87fdd9
Reapply "Skipping host target exports during cross-compilation" (#210… (#210496)
This reverts commit 42eb7db188. This
reland 3fbb037d03 (#209922).

Under CMake 4+, calling add_library(... SHARED IMPORTED) on a target
platform that lacks dynamic linking support triggers a fatal error. This
becomes an issue when building LLVM and runtimes for baremetal targets
like armv6m-none-eabi. This patch adds the option
"LLVM_OMIT_EXPORTS_FROM_CONFIG" in LLVM. When used in sub builds like
LLVM runtimes, it makes CMake to skip including the LLVM and Clang
exports. This mitigates the CMake 4 errors on baremetal runtimes.

42eb7db188 originally
apply this flag on all runtimes build and causing issues on runtimes
like intel-sycl-gpu, amdgpu-offload-ubuntu-22-cmake-build-only.
This PR only set this flag when the target platform lacks shared library
support.
2026-07-20 10:47:59 -07:00
..
AddClang.cmake [CMake] Propagate dependencies to OBJECT libraries in add_llvm_library (re-land) (#184201) 2026-03-02 23:10:15 +02:00
AddGRPC.cmake [clangd] Disable PCH for libs that use gRPC (#185185) 2026-03-07 13:35:51 +00:00
ClangConfig.cmake.in Reapply "Skipping host target exports during cross-compilation" (#210… (#210496) 2026-07-20 10:47:59 -07:00
ClangConfigVersion.cmake.in
CMakeLists.txt fix clang_cmake_builddir (#161220) 2025-10-16 13:18:19 +02:00
ProtobufMutator.cmake