File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -698,6 +698,13 @@ add_library(zigcpp STATIC ${ZIG_CPP_SOURCES})
698
698
target_compile_features (zigcpp PRIVATE cxx_std_17 )
699
699
set_target_properties (zigcpp PROPERTIES POSITION_INDEPENDENT_CODE ${ZIG_PIE} )
700
700
701
+ if (LLVM_LINK_MODE STREQUAL "static" )
702
+ target_compile_definitions (zigcpp PRIVATE
703
+ LLVM_BUILD_STATIC
704
+ CLANG_BUILD_STATIC
705
+ )
706
+ endif ()
707
+
701
708
if (NOT MSVC )
702
709
if (MINGW )
703
710
target_compile_options (zigcpp PRIVATE -Wno-format )
Original file line number Diff line number Diff line change @@ -706,6 +706,9 @@ const exe_cflags = [_][]const u8{
706
706
"-Wno-type-limits" ,
707
707
"-Wno-missing-braces" ,
708
708
"-Wno-comment" ,
709
+ // `exe_cflags` is only used for static linking.
710
+ "-DLLVM_BUILD_STATIC" ,
711
+ "-DCLANG_BUILD_STATIC" ,
709
712
};
710
713
711
714
fn addCmakeCfgOptionsToExe (
You can’t perform that action at this time.
0 commit comments