Skip to content

Commit e08a4ea

Browse files
committedJan 5, 2018
Merge branch 'appveyor'
·
0.15.20.2.0
2 parents 7e65fe7 + 2c35e24 commit e08a4ea

File tree

9 files changed

+47
-17
lines changed

9 files changed

+47
-17
lines changed
 

‎CMakeLists.txt‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,14 @@ set(ZIG_C_HEADER_FILES
570570
"xtestintrin.h"
571571
)
572572

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+
573581
set(ZIG_LIB_DIR "lib/zig")
574582
set(C_HEADERS_DEST "${ZIG_LIB_DIR}/include")
575583
set(ZIG_STD_DEST "${ZIG_LIB_DIR}/std")
@@ -631,6 +639,10 @@ target_link_libraries(zig LINK_PUBLIC
631639
${LLVM_LIBRARIES}
632640
${CMAKE_THREAD_LIBS_INIT}
633641
)
642+
if(ZIG_DIA_GUIDS_LIB)
643+
target_link_libraries(zig LINK_PUBLIC ${ZIG_DIA_GUIDS_LIB})
644+
endif()
645+
634646
if(MSVC OR MINGW)
635647
target_link_libraries(zig LINK_PUBLIC version)
636648
endif()

‎build.zig‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub fn build(b: &Builder) {
4545
const lld_libraries = nextValue(&index, build_info);
4646
const std_files = nextValue(&index, build_info);
4747
const c_header_files = nextValue(&index, build_info);
48+
const dia_guids_lib = nextValue(&index, build_info);
4849

4950
const llvm = findLLVM(b, llvm_config_exe);
5051

@@ -76,11 +77,21 @@ pub fn build(b: &Builder) {
7677
exe.linkSystemLibrary("c++");
7778
}
7879

80+
if (dia_guids_lib.len != 0) {
81+
exe.addObjectFile(dia_guids_lib);
82+
}
83+
7984
exe.linkSystemLibrary("c");
8085

8186
b.default_step.dependOn(&exe.step);
8287
b.default_step.dependOn(docs_step);
83-
test_step.dependOn(&exe.step);
88+
89+
const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") ?? false;
90+
if (!skip_self_hosted) {
91+
test_step.dependOn(&exe.step);
92+
}
93+
const verbose_link_exe = b.option(bool, "verbose-link", "Print link command for self hosted compiler") ?? false;
94+
exe.setVerboseLink(verbose_link_exe);
8495

8596
b.installArtifact(exe);
8697
installStdLib(b, std_files);

‎ci/appveyor/appveyor.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ build_script:
66
after_build:
77
- '%APPVEYOR_BUILD_FOLDER%\ci\appveyor\after_build.bat'
88
cache:
9-
- 'llvm+clang-5.0.0-win64-msvc-release.tar.xz'
9+
- 'llvm+clang-5.0.1-win64-msvc-release.tar.xz'

‎ci/appveyor/build_script.bat‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@ SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
77
SET "MSYSTEM=MINGW64"
88
SET "APPVEYOR_CACHE_ENTRY_ZIP_ARGS=-m0=Copy"
99

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
1111

1212

1313
SET "PATH=%PREVPATH%"
1414
SET "MSYSTEM=%PREVMSYSTEM%"
1515
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+
18+
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
19+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
1720

1821
mkdir %ZIGBUILDDIR%
1922
cd %ZIGBUILDDIR%
2023
cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release "-DZIG_LIBC_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-DZIG_LIBC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt" "-DZIG_LIBC_STATIC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" || exit /b
2124
msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b
2225

23-
bin\zig.exe build --build-file ..\build.zig test || exit /b
26+
bin\zig.exe build --build-file ..\build.zig test -Dverbose-link || exit /b
2427

2528
@echo "MSVC build succeeded, proceeding with MinGW build"
2629
cd %APPVEYOR_BUILD_FOLDER%

‎src/config.h.in‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
#define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@"
3333
#define ZIG_STD_FILES "@ZIG_STD_FILES@"
3434
#define ZIG_C_HEADER_FILES "@ZIG_C_HEADER_FILES@"
35+
#define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@"
3536

3637
#endif

‎src/main.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,15 @@ static void add_package(CodeGen *g, CliPkg *cli_pkg, PackageTableEntry *pkg) {
267267

268268
int main(int argc, char **argv) {
269269
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",
271271
ZIG_CMAKE_BINARY_DIR,
272272
ZIG_CXX_COMPILER,
273273
ZIG_LLVM_CONFIG_EXE,
274274
ZIG_LLD_INCLUDE_PATH,
275275
ZIG_LLD_LIBRARIES,
276276
ZIG_STD_FILES,
277-
ZIG_C_HEADER_FILES);
277+
ZIG_C_HEADER_FILES,
278+
ZIG_DIA_GUIDS_LIB);
278279
return 0;
279280
}
280281

‎src/os.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,11 @@ int os_find_windows_sdk(ZigWindowsSDK **out_sdk) {
10551055
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
10561056
int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
10571057
sscanf(ffd.cFileName, "%d.%d.%d.%d", &c0, &c1, &c2, &c3);
1058+
if (c0 == 10 && c1 == 0 && c2 == 10240 && c3 == 0) {
1059+
// Microsoft released 26624 as 10240 accidentally.
1060+
// https://developer.microsoft.com/en-us/windows/downloads/sdk-archive
1061+
c2 = 26624;
1062+
}
10581063
if ((c0 > v0) || (c1 > v1) || (c2 > v2) || (c3 > v3)) {
10591064
v0 = c0, v1 = c1, v2 = c2, v3 = c3;
10601065
buf_init_from_str(&result_sdk->version10, ffd.cFileName);

‎std/build.zig‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,10 @@ pub const LibExeObjStep = struct {
842842
lib_paths: ArrayList([]const u8),
843843
disable_libc: bool,
844844
frameworks: BufSet,
845+
verbose_link: bool,
845846

846847
// zig only stuff
847848
root_src: ?[]const u8,
848-
verbose: bool,
849849
output_h_path: ?[]const u8,
850850
out_h_filename: []const u8,
851851
assembly_files: ArrayList([]const u8),
@@ -923,7 +923,7 @@ pub const LibExeObjStep = struct {
923923
var self = LibExeObjStep {
924924
.strip = false,
925925
.builder = builder,
926-
.verbose = false,
926+
.verbose_link = false,
927927
.build_mode = builtin.Mode.Debug,
928928
.static = static,
929929
.kind = kind,
@@ -988,7 +988,7 @@ pub const LibExeObjStep = struct {
988988
.linker_script = null,
989989

990990
.root_src = undefined,
991-
.verbose = undefined,
991+
.verbose_link = false,
992992
.output_h_path = undefined,
993993
.out_h_filename = undefined,
994994
.assembly_files = undefined,
@@ -1087,8 +1087,8 @@ pub const LibExeObjStep = struct {
10871087
%%self.source_files.append(file);
10881088
}
10891089

1090-
pub fn setVerbose(self: &LibExeObjStep, value: bool) {
1091-
self.verbose = value;
1090+
pub fn setVerboseLink(self: &LibExeObjStep, value: bool) {
1091+
self.verbose_link = value;
10921092
}
10931093

10941094
pub fn setBuildMode(self: &LibExeObjStep, mode: builtin.Mode) {
@@ -1223,15 +1223,12 @@ pub const LibExeObjStep = struct {
12231223
%%zig_args.append(builder.pathFromRoot(asm_file));
12241224
}
12251225

1226-
if (self.verbose) {
1227-
%%zig_args.append("--verbose");
1228-
}
12291226
if (builder.verbose_tokenize) %%zig_args.append("--verbose-tokenize");
12301227
if (builder.verbose_ast) %%zig_args.append("--verbose-ast");
12311228
if (builder.verbose_cimport) %%zig_args.append("--verbose-cimport");
12321229
if (builder.verbose_ir) %%zig_args.append("--verbose-ir");
12331230
if (builder.verbose_llvm_ir) %%zig_args.append("--verbose-llvm-ir");
1234-
if (builder.verbose_link) %%zig_args.append("--verbose-link");
1231+
if (builder.verbose_link or self.verbose_link) %%zig_args.append("--verbose-link");
12351232

12361233
if (self.strip) {
12371234
%%zig_args.append("--strip");

‎std/special/build_runner.zig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn main() -> %void {
1414
var arg_it = os.args();
1515

1616
// TODO use a more general purpose allocator here
17-
var inc_allocator = %%std.heap.IncrementingAllocator.init(30 * 1024 * 1024);
17+
var inc_allocator = %%std.heap.IncrementingAllocator.init(40 * 1024 * 1024);
1818
defer inc_allocator.deinit();
1919

2020
const allocator = &inc_allocator.allocator;

0 commit comments

Comments
 (0)
Please sign in to comment.