| author | |
| committer | |
| log | a9df637fb11713c41024e6f3b6a1f4f86c33b09e |
| tree | c2514bb948c46d998619ba8c5739dff733e4cfaa |
| parent | d0b12d77267da601e69bd633fe3f56b8bf01c1cf |
| signature |
4 files changed, 16 insertions(+), 4 deletions(-)
CMakeLists.txt+5-3| ... | @@ -364,6 +364,11 @@ add_library(zig_cpp STATIC ${ZIG_CPP_SOURCES}) | ... | @@ -364,6 +364,11 @@ add_library(zig_cpp STATIC ${ZIG_CPP_SOURCES}) |
| 364 | set_target_properties(zig_cpp PROPERTIES | 364 | set_target_properties(zig_cpp PROPERTIES |
| 365 | COMPILE_FLAGS ${EXE_CFLAGS} | 365 | COMPILE_FLAGS ${EXE_CFLAGS} |
| 366 | ) | 366 | ) |
| 367 | target_link_libraries(zig_cpp LINK_PUBLIC | ||
| 368 | ${CLANG_LIBRARIES} | ||
| 369 | ${LLD_LIBRARIES} | ||
| 370 | ${LLVM_LIBRARIES} | ||
| 371 | ) | ||
| 367 | 372 | ||
| 368 | add_library(opt_c_util STATIC ${OPTIMIZED_C_SOURCES}) | 373 | add_library(opt_c_util STATIC ${OPTIMIZED_C_SOURCES}) |
| 369 | set_target_properties(opt_c_util PROPERTIES | 374 | set_target_properties(opt_c_util PROPERTIES |
| ... | @@ -379,9 +384,6 @@ target_link_libraries(compiler LINK_PUBLIC | ... | @@ -379,9 +384,6 @@ target_link_libraries(compiler LINK_PUBLIC |
| 379 | zig_cpp | 384 | zig_cpp |
| 380 | opt_c_util | 385 | opt_c_util |
| 381 | ${SOFTFLOAT_LIBRARIES} | 386 | ${SOFTFLOAT_LIBRARIES} |
| 382 | ${CLANG_LIBRARIES} | ||
| 383 | ${LLD_LIBRARIES} | ||
| 384 | ${LLVM_LIBRARIES} | ||
| 385 | ${CMAKE_THREAD_LIBS_INIT} | 387 | ${CMAKE_THREAD_LIBS_INIT} |
| 386 | ) | 388 | ) |
| 387 | if(NOT MSVC) | 389 | if(NOT MSVC) |
build.zig+8| ... | @@ -47,6 +47,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -47,6 +47,7 @@ pub fn build(b: *Builder) !void { |
| 47 | .llvm_config_exe = nextValue(&index, build_info), | 47 | .llvm_config_exe = nextValue(&index, build_info), |
| 48 | .lld_include_dir = nextValue(&index, build_info), | 48 | .lld_include_dir = nextValue(&index, build_info), |
| 49 | .lld_libraries = nextValue(&index, build_info), | 49 | .lld_libraries = nextValue(&index, build_info), |
| 50 | .clang_libraries = nextValue(&index, build_info), | ||
| 50 | .dia_guids_lib = nextValue(&index, build_info), | 51 | .dia_guids_lib = nextValue(&index, build_info), |
| 51 | .llvm = undefined, | 52 | .llvm = undefined, |
| 52 | }; | 53 | }; |
| ... | @@ -299,6 +300,12 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void { | ... | @@ -299,6 +300,12 @@ fn configureStage2(b: *Builder, exe: var, ctx: Context) !void { |
| 299 | addCppLib(b, exe, ctx.cmake_binary_dir, "embedded_lld_coff"); | 300 | addCppLib(b, exe, ctx.cmake_binary_dir, "embedded_lld_coff"); |
| 300 | addCppLib(b, exe, ctx.cmake_binary_dir, "embedded_lld_lib"); | 301 | addCppLib(b, exe, ctx.cmake_binary_dir, "embedded_lld_lib"); |
| 301 | } | 302 | } |
| 303 | { | ||
| 304 | var it = mem.tokenize(ctx.clang_libraries, ";"); | ||
| 305 | while (it.next()) |lib| { | ||
| 306 | exe.addObjectFile(lib); | ||
| 307 | } | ||
| 308 | } | ||
| 302 | dependOnLib(b, exe, ctx.llvm); | 309 | dependOnLib(b, exe, ctx.llvm); |
| 303 | 310 | ||
| 304 | if (exe.target.getOs() == .linux) { | 311 | if (exe.target.getOs() == .linux) { |
| ... | @@ -364,6 +371,7 @@ const Context = struct { | ... | @@ -364,6 +371,7 @@ const Context = struct { |
| 364 | llvm_config_exe: []const u8, | 371 | llvm_config_exe: []const u8, |
| 365 | lld_include_dir: []const u8, | 372 | lld_include_dir: []const u8, |
| 366 | lld_libraries: []const u8, | 373 | lld_libraries: []const u8, |
| 374 | clang_libraries: []const u8, | ||
| 367 | dia_guids_lib: []const u8, | 375 | dia_guids_lib: []const u8, |
| 368 | llvm: LibraryDep, | 376 | llvm: LibraryDep, |
| 369 | }; | 377 | }; |
src/config.h.in+1| ... | @@ -18,6 +18,7 @@ | ... | @@ -18,6 +18,7 @@ |
| 18 | #define ZIG_CXX_COMPILER "@CMAKE_CXX_COMPILER@" | 18 | #define ZIG_CXX_COMPILER "@CMAKE_CXX_COMPILER@" |
| 19 | #define ZIG_LLD_INCLUDE_PATH "@LLD_INCLUDE_DIRS@" | 19 | #define ZIG_LLD_INCLUDE_PATH "@LLD_INCLUDE_DIRS@" |
| 20 | #define ZIG_LLD_LIBRARIES "@LLD_LIBRARIES@" | 20 | #define ZIG_LLD_LIBRARIES "@LLD_LIBRARIES@" |
| 21 | #define ZIG_CLANG_LIBRARIES "@CLANG_LIBRARIES@" | ||
| 21 | #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" | 22 | #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" |
| 22 | #define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" | 23 | #define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" |
| 23 | 24 |
src/main.cpp+2-1| ... | @@ -261,12 +261,13 @@ int main(int argc, char **argv) { | ... | @@ -261,12 +261,13 @@ int main(int argc, char **argv) { |
| 261 | Error err; | 261 | Error err; |
| 262 | 262 | ||
| 263 | if (argc == 2 && strcmp(argv[1], "BUILD_INFO") == 0) { | 263 | if (argc == 2 && strcmp(argv[1], "BUILD_INFO") == 0) { |
| 264 | printf("%s\n%s\n%s\n%s\n%s\n%s\n", | 264 | printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", |
| 265 | ZIG_CMAKE_BINARY_DIR, | 265 | ZIG_CMAKE_BINARY_DIR, |
| 266 | ZIG_CXX_COMPILER, | 266 | ZIG_CXX_COMPILER, |
| 267 | ZIG_LLVM_CONFIG_EXE, | 267 | ZIG_LLVM_CONFIG_EXE, |
| 268 | ZIG_LLD_INCLUDE_PATH, | 268 | ZIG_LLD_INCLUDE_PATH, |
| 269 | ZIG_LLD_LIBRARIES, | 269 | ZIG_LLD_LIBRARIES, |
| 270 | ZIG_CLANG_LIBRARIES, | ||
| 270 | ZIG_DIA_GUIDS_LIB); | 271 | ZIG_DIA_GUIDS_LIB); |
| 271 | return 0; | 272 | return 0; |
| 272 | } | 273 | } |