mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
build: Set LLVM_BUILD_STATIC/CLANG_BUILD_STATIC when linking statically.
This is needed since LLVM 20, particularly for Windows.
This commit is contained in:
parent
7733b5dbe6
commit
1bfc71d4da
2 changed files with 10 additions and 0 deletions
|
|
@ -698,6 +698,13 @@ add_library(zigcpp STATIC ${ZIG_CPP_SOURCES})
|
|||
target_compile_features(zigcpp PRIVATE cxx_std_17)
|
||||
set_target_properties(zigcpp PROPERTIES POSITION_INDEPENDENT_CODE ${ZIG_PIE})
|
||||
|
||||
if(LLVM_LINK_MODE STREQUAL "static")
|
||||
target_compile_definitions(zigcpp PRIVATE
|
||||
LLVM_BUILD_STATIC
|
||||
CLANG_BUILD_STATIC
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
if(MINGW)
|
||||
target_compile_options(zigcpp PRIVATE -Wno-format)
|
||||
|
|
|
|||
|
|
@ -706,6 +706,9 @@ const exe_cflags = [_][]const u8{
|
|||
"-Wno-type-limits",
|
||||
"-Wno-missing-braces",
|
||||
"-Wno-comment",
|
||||
// `exe_cflags` is only used for static linking.
|
||||
"-DLLVM_BUILD_STATIC",
|
||||
"-DCLANG_BUILD_STATIC",
|
||||
};
|
||||
|
||||
fn addCmakeCfgOptionsToExe(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue