| author | |
| committer | |
| log | 1b120d1e49106d0683cc3e6ed766fd8534f798f2 |
| tree | c5de4b08751a74fff80735b7f76fa9ac505e8bb9 |
| parent | 21a552682ef51b03648c5b5a47de2f623bd71cfd |
llvm-config.exe does not handle diaguids.lib for us so we have to
duplicate the work.5 files changed, 23 insertions(+), 4 deletions(-)
CMakeLists.txt+12| ... | ... | @@ -570,6 +570,14 @@ set(ZIG_C_HEADER_FILES |
| 570 | 570 | "xtestintrin.h" |
| 571 | 571 | ) |
| 572 | 572 | |
| 573 | if(MSVC) | |
| 574 | set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK") | |
| 575 | if (IS_DIRECTORY ${MSVC_DIA_SDK_DIR}) | |
| 576 | set(ZIG_DIA_GUIDS_LIB "${MSVC_DIA_SDK_DIR}/lib/amd64/diaguids.lib") | |
| 577 | string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_DIA_GUIDS_LIB_ESCAPED "${ZIG_DIA_GUIDS_LIB}") | |
| 578 | endif() | |
| 579 | endif() | |
| 580 | ||
| 573 | 581 | set(ZIG_LIB_DIR "lib/zig") |
| 574 | 582 | set(C_HEADERS_DEST "${ZIG_LIB_DIR}/include") |
| 575 | 583 | set(ZIG_STD_DEST "${ZIG_LIB_DIR}/std") |
| ... | ... | @@ -631,6 +639,10 @@ target_link_libraries(zig LINK_PUBLIC |
| 631 | 639 | ${LLVM_LIBRARIES} |
| 632 | 640 | ${CMAKE_THREAD_LIBS_INIT} |
| 633 | 641 | ) |
| 642 | if(ZIG_DIA_GUIDS_LIB) | |
| 643 | target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB}) | |
| 644 | endif() | |
| 645 | ||
| 634 | 646 | if(MSVC OR MINGW) |
| 635 | 647 | target_link_libraries(zig LINK_PUBLIC version) |
| 636 | 648 | endif() |
build.zig+5| ... | ... | @@ -45,6 +45,7 @@ pub fn build(b: &Builder) { |
| 45 | 45 | const lld_libraries = nextValue(&index, build_info); |
| 46 | 46 | const std_files = nextValue(&index, build_info); |
| 47 | 47 | const c_header_files = nextValue(&index, build_info); |
| 48 | const dia_guids_lib = nextValue(&index, build_info); | |
| 48 | 49 | |
| 49 | 50 | const llvm = findLLVM(b, llvm_config_exe); |
| 50 | 51 | |
| ... | ... | @@ -76,6 +77,10 @@ pub fn build(b: &Builder) { |
| 76 | 77 | exe.linkSystemLibrary("c++"); |
| 77 | 78 | } |
| 78 | 79 | |
| 80 | if (dia_guids_lib.len != 0) { | |
| 81 | exe.addObjectFile(dia_guids_lib); | |
| 82 | } | |
| 83 | ||
| 79 | 84 | exe.linkSystemLibrary("c"); |
| 80 | 85 | |
| 81 | 86 | b.default_step.dependOn(&exe.step); |
ci/appveyor/build_script.bat+2-2| ... | ... | @@ -7,13 +7,13 @@ SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%" |
| 7 | 7 | SET "MSYSTEM=MINGW64" |
| 8 | 8 | SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy" |
| 9 | 9 | |
| 10 | bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.0-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/superjoe/temp/llvm%%2bclang-5.0.0-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.0-win64-msvc-release.tar.xz" || exit /b | |
| 10 | bash -lc "cd ${APPVEYOR_BUILD_FOLDER} && if [ -s ""llvm+clang-5.0.1-win64-msvc-release.tar.xz"" ]; then echo 'skipping LLVM download'; else wget 'https://s3.amazonaws.com/ziglang.org/deps/llvm%%2bclang-5.0.1-win64-msvc-release.tar.xz'; fi && tar xf llvm+clang-5.0.1-win64-msvc-release.tar.xz" || exit /b | |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | SET "PATH=%PREVPATH%" |
| 14 | 14 | SET "MSYSTEM=%PREVMSYSTEM%" |
| 15 | 15 | SET "ZIGBUILDDIR=%APPVEYOR_BUILD_FOLDER%\build-msvc-release" |
| 16 | SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.0-win64-msvc-release" | |
| 16 | SET "ZIGPREFIXPATH=%APPVEYOR_BUILD_FOLDER%\llvm+clang-5.0.1-win64-msvc-release" | |
| 17 | 17 | |
| 18 | 18 | mkdir %ZIGBUILDDIR% |
| 19 | 19 | cd %ZIGBUILDDIR% |
src/config.h.in+1| ... | ... | @@ -32,5 +32,6 @@ |
| 32 | 32 | #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" |
| 33 | 33 | #define ZIG_STD_FILES "@ZIG_STD_FILES@" |
| 34 | 34 | #define ZIG_C_HEADER_FILES "@ZIG_C_HEADER_FILES@" |
| 35 | #define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" | |
| 35 | 36 | |
| 36 | 37 | #endif |
src/main.cpp+3-2| ... | ... | @@ -267,14 +267,15 @@ static void add_package(CodeGen *g, CliPkg *cli_pkg, PackageTableEntry *pkg) { |
| 267 | 267 | |
| 268 | 268 | int main(int argc, char **argv) { |
| 269 | 269 | if (argc == 2 && strcmp(argv[1], "BUILD_INFO") == 0) { |
| 270 | printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", | |
| 270 | printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", | |
| 271 | 271 | ZIG_CMAKE_BINARY_DIR, |
| 272 | 272 | ZIG_CXX_COMPILER, |
| 273 | 273 | ZIG_LLVM_CONFIG_EXE, |
| 274 | 274 | ZIG_LLD_INCLUDE_PATH, |
| 275 | 275 | ZIG_LLD_LIBRARIES, |
| 276 | 276 | ZIG_STD_FILES, |
| 277 | ZIG_C_HEADER_FILES); | |
| 277 | ZIG_C_HEADER_FILES, | |
| 278 | ZIG_DIA_GUIDS_LIB); | |
| 278 | 279 | return 0; |
| 279 | 280 | } |
| 280 | 281 |