Skip to content

Commit 44f75a2

Browse files
authored
Merge branch 'master' into stage2-astgen-try
2 parents a2e3576 + 2b0e3ee commit 44f75a2

File tree

627 files changed

+17048
-7374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

627 files changed

+17048
-7374
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# -andrewrk
1111

1212
zig-cache/
13+
/release/
14+
/debug/
1315
/build/
1416
/build-*/
1517
/docgen_tmp/

CMakeLists.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ if("${ZIG_VERSION}" STREQUAL "")
4444
# Tagged release version.
4545
set(GIT_TAG ${CMAKE_MATCH_1})
4646
if(NOT GIT_TAG VERSION_EQUAL ZIG_VERSION)
47-
message(SEND_ERROR "Configured Zig version (${ZIG_VERSION}) does not match Git tag (${GIT_TAG}).")
47+
message(SEND_ERROR "Zig version (${ZIG_VERSION}) does not match Git tag (${GIT_TAG}).")
4848
endif()
49-
elseif(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-(.+)$")
49+
elseif(GIT_DESCRIBE MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-g(.+)$")
5050
# Untagged pre-release. The Zig version is updated to include the number of commits
5151
# since the last tagged version and the commit hash. The version is formatted in
5252
# accordance with the https://semver.org specification.
5353
set(GIT_TAG ${CMAKE_MATCH_1})
5454
set(GIT_COMMITS_AFTER_TAG ${CMAKE_MATCH_2})
5555
set(GIT_COMMIT ${CMAKE_MATCH_3})
5656
if(NOT ZIG_VERSION VERSION_GREATER GIT_TAG)
57-
message(SEND_ERROR "Configured Zig version (${ZIG_VERSION}) must be greater than tagged ancestor (${GIT_TAG}).")
57+
message(SEND_ERROR "Zig version (${ZIG_VERSION}) must be greater than tagged ancestor (${GIT_TAG}).")
5858
endif()
5959
set(ZIG_VERSION "${ZIG_VERSION}-dev.${GIT_COMMITS_AFTER_TAG}+${GIT_COMMIT}")
6060
else()
@@ -89,6 +89,7 @@ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries
8989
set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
9090
set(ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed")
9191
set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")
92+
set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")
9293

9394
find_package(llvm)
9495
find_package(clang)
@@ -374,10 +375,11 @@ set(ZIG_STAGE2_SOURCES
374375
"${CMAKE_SOURCE_DIR}/lib/std/io/buffered_atomic_file.zig"
375376
"${CMAKE_SOURCE_DIR}/lib/std/io/buffered_writer.zig"
376377
"${CMAKE_SOURCE_DIR}/lib/std/io/change_detection_stream.zig"
377-
"${CMAKE_SOURCE_DIR}/lib/std/io/counting_writer.zig"
378378
"${CMAKE_SOURCE_DIR}/lib/std/io/counting_reader.zig"
379-
"${CMAKE_SOURCE_DIR}/lib/std/io/find_byte_out_stream.zig"
379+
"${CMAKE_SOURCE_DIR}/lib/std/io/counting_writer.zig"
380+
"${CMAKE_SOURCE_DIR}/lib/std/io/find_byte_writer.zig"
380381
"${CMAKE_SOURCE_DIR}/lib/std/io/fixed_buffer_stream.zig"
382+
"${CMAKE_SOURCE_DIR}/lib/std/io/limited_reader.zig"
381383
"${CMAKE_SOURCE_DIR}/lib/std/io/reader.zig"
382384
"${CMAKE_SOURCE_DIR}/lib/std/io/seekable_stream.zig"
383385
"${CMAKE_SOURCE_DIR}/lib/std/io/writer.zig"
@@ -492,7 +494,7 @@ set(ZIG_STAGE2_SOURCES
492494
"${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/udivmodti4.zig"
493495
"${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/udivti3.zig"
494496
"${CMAKE_SOURCE_DIR}/lib/std/special/compiler_rt/umodti3.zig"
495-
"${CMAKE_SOURCE_DIR}/lib/std/spinlock.zig"
497+
"${CMAKE_SOURCE_DIR}/lib/std/SpinLock.zig"
496498
"${CMAKE_SOURCE_DIR}/lib/std/start.zig"
497499
"${CMAKE_SOURCE_DIR}/lib/std/std.zig"
498500
"${CMAKE_SOURCE_DIR}/lib/std/target.zig"
@@ -540,6 +542,8 @@ set(ZIG_STAGE2_SOURCES
540542
"${CMAKE_SOURCE_DIR}/src/codegen/aarch64.zig"
541543
"${CMAKE_SOURCE_DIR}/src/codegen/arm.zig"
542544
"${CMAKE_SOURCE_DIR}/src/codegen/c.zig"
545+
"${CMAKE_SOURCE_DIR}/src/codegen/llvm.zig"
546+
"${CMAKE_SOURCE_DIR}/src/codegen/llvm/bindings.zig"
543547
"${CMAKE_SOURCE_DIR}/src/codegen/riscv64.zig"
544548
"${CMAKE_SOURCE_DIR}/src/codegen/spu-mk2.zig"
545549
"${CMAKE_SOURCE_DIR}/src/codegen/wasm.zig"
@@ -558,11 +562,9 @@ set(ZIG_STAGE2_SOURCES
558562
"${CMAKE_SOURCE_DIR}/src/link/MachO.zig"
559563
"${CMAKE_SOURCE_DIR}/src/link/MachO/Trie.zig"
560564
"${CMAKE_SOURCE_DIR}/src/link/Wasm.zig"
561-
"${CMAKE_SOURCE_DIR}/src/link/cbe.h"
565+
"${CMAKE_SOURCE_DIR}/src/link/C/zig.h"
562566
"${CMAKE_SOURCE_DIR}/src/link/msdos-stub.bin"
563567
"${CMAKE_SOURCE_DIR}/src/liveness.zig"
564-
"${CMAKE_SOURCE_DIR}/src/llvm_backend.zig"
565-
"${CMAKE_SOURCE_DIR}/src/llvm_bindings.zig"
566568
"${CMAKE_SOURCE_DIR}/src/main.zig"
567569
"${CMAKE_SOURCE_DIR}/src/mingw.zig"
568570
"${CMAKE_SOURCE_DIR}/src/musl.zig"
@@ -587,6 +589,12 @@ if(MSVC)
587589
endif()
588590
endif()
589591

592+
if(ZIG_OMIT_STAGE2)
593+
set(ZIG_OMIT_STAGE2_BOOL "true")
594+
else()
595+
set(ZIG_OMIT_STAGE2_BOOL "false")
596+
endif()
597+
590598
configure_file (
591599
"${CMAKE_SOURCE_DIR}/src/stage1/config.h.in"
592600
"${ZIG_CONFIG_H_OUT}"

0 commit comments

Comments
 (0)