| ... | @@ -91,20 +91,6 @@ pub fn build(b: *Builder) !void { | ... | @@ -91,20 +91,6 @@ pub fn build(b: *Builder) !void { |
| 91 | exe.addBuildOption(bool, "have_llvm", enable_llvm); | 91 | exe.addBuildOption(bool, "have_llvm", enable_llvm); |
| 92 | if (enable_llvm) { | 92 | if (enable_llvm) { |
| 93 | const cmake_cfg = if (static_llvm) null else findAndParseConfigH(b, config_h_path_option); | 93 | const cmake_cfg = if (static_llvm) null else findAndParseConfigH(b, config_h_path_option); |
| 94 | | | |
| 95 | const exe_cflags = [_][]const u8{ | | |
| 96 | "-std=c++14", | | |
| 97 | "-D__STDC_CONSTANT_MACROS", | | |
| 98 | "-D__STDC_FORMAT_MACROS", | | |
| 99 | "-D__STDC_LIMIT_MACROS", | | |
| 100 | "-D_GNU_SOURCE", | | |
| 101 | "-fvisibility-inlines-hidden", | | |
| 102 | "-fno-exceptions", | | |
| 103 | "-fno-rtti", | | |
| 104 | "-Werror=type-limits", | | |
| 105 | "-Wno-missing-braces", | | |
| 106 | "-Wno-comment", | | |
| 107 | }; | | |
| 108 | if (is_stage1) { | 94 | if (is_stage1) { |
| 109 | exe.addIncludeDir("src"); | 95 | exe.addIncludeDir("src"); |
| 110 | exe.addIncludeDir("deps/SoftFloat-3e/source/include"); | 96 | exe.addIncludeDir("deps/SoftFloat-3e/source/include"); |
| ... | @@ -123,6 +109,19 @@ pub fn build(b: *Builder) !void { | ... | @@ -123,6 +109,19 @@ pub fn build(b: *Builder) !void { |
| 123 | softfloat.addCSourceFiles(&softfloat_sources, &[_][]const u8{ "-std=c99", "-O3" }); | 109 | softfloat.addCSourceFiles(&softfloat_sources, &[_][]const u8{ "-std=c99", "-O3" }); |
| 124 | exe.linkLibrary(softfloat); | 110 | exe.linkLibrary(softfloat); |
| 125 | | 111 | |
| | 112 | const exe_cflags = [_][]const u8{ |
| | 113 | "-std=c++14", |
| | 114 | "-D__STDC_CONSTANT_MACROS", |
| | 115 | "-D__STDC_FORMAT_MACROS", |
| | 116 | "-D__STDC_LIMIT_MACROS", |
| | 117 | "-D_GNU_SOURCE", |
| | 118 | "-fvisibility-inlines-hidden", |
| | 119 | "-fno-exceptions", |
| | 120 | "-fno-rtti", |
| | 121 | "-Werror=type-limits", |
| | 122 | "-Wno-missing-braces", |
| | 123 | "-Wno-comment", |
| | 124 | }; |
| 126 | exe.addCSourceFiles(&stage1_sources, &exe_cflags); | 125 | exe.addCSourceFiles(&stage1_sources, &exe_cflags); |
| 127 | exe.addCSourceFiles(&optimized_c_sources, &[_][]const u8{ "-std=c99", "-O3" }); | 126 | exe.addCSourceFiles(&optimized_c_sources, &[_][]const u8{ "-std=c99", "-O3" }); |
| 128 | if (cmake_cfg == null) { | 127 | if (cmake_cfg == null) { |
| ... | @@ -206,12 +205,6 @@ pub fn build(b: *Builder) !void { | ... | @@ -206,12 +205,6 @@ pub fn build(b: *Builder) !void { |
| 206 | exe.linkSystemLibrary(lib_name); | 205 | exe.linkSystemLibrary(lib_name); |
| 207 | } | 206 | } |
| 208 | | 207 | |
| 209 | // We need this because otherwise zig_clang_cc1_main.cpp ends up pulling | | |
| 210 | // in a dependency on llvm::cfg::Update<llvm::BasicBlock*>::dump() which is | | |
| 211 | // unavailable when LLVM is compiled in Release mode. | | |
| 212 | const zig_cpp_cflags = exe_cflags ++ [_][]const u8{"-DNDEBUG=1"}; | | |
| 213 | exe.addCSourceFiles(&zig_cpp_sources, &zig_cpp_cflags); | | |
| 214 | | | |
| 215 | // This means we rely on clang-or-zig-built LLVM, Clang, LLD libraries. | 208 | // This means we rely on clang-or-zig-built LLVM, Clang, LLD libraries. |
| 216 | exe.linkSystemLibrary("c++"); | 209 | exe.linkSystemLibrary("c++"); |
| 217 | | 210 | |