@@ -44,17 +44,17 @@ if("${ZIG_VERSION}" STREQUAL "")
44
44
# Tagged release version.
45
45
set (GIT_TAG ${CMAKE_MATCH_1} )
46
46
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} )." )
48
48
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 (.+)$" )
50
50
# Untagged pre-release. The Zig version is updated to include the number of commits
51
51
# since the last tagged version and the commit hash. The version is formatted in
52
52
# accordance with the https://semver.org specification.
53
53
set (GIT_TAG ${CMAKE_MATCH_1} )
54
54
set (GIT_COMMITS_AFTER_TAG ${CMAKE_MATCH_2} )
55
55
set (GIT_COMMIT ${CMAKE_MATCH_3} )
56
56
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} )." )
58
58
endif ()
59
59
set (ZIG_VERSION "${ZIG_VERSION} -dev.${GIT_COMMITS_AFTER_TAG} +${GIT_COMMIT} " )
60
60
else ()
@@ -89,6 +89,7 @@ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries
89
89
set (ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary" )
90
90
set (ZIG_PREFER_LLVM_CONFIG off CACHE BOOL "(when cross compiling) use llvm-config to find target llvm dependencies if needed" )
91
91
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" )
92
93
93
94
find_package (llvm)
94
95
find_package (clang)
@@ -374,10 +375,11 @@ set(ZIG_STAGE2_SOURCES
374
375
"${CMAKE_SOURCE_DIR} /lib/std/io/buffered_atomic_file.zig"
375
376
"${CMAKE_SOURCE_DIR} /lib/std/io/buffered_writer.zig"
376
377
"${CMAKE_SOURCE_DIR} /lib/std/io/change_detection_stream.zig"
377
- "${CMAKE_SOURCE_DIR} /lib/std/io/counting_writer.zig"
378
378
"${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"
380
381
"${CMAKE_SOURCE_DIR} /lib/std/io/fixed_buffer_stream.zig"
382
+ "${CMAKE_SOURCE_DIR} /lib/std/io/limited_reader.zig"
381
383
"${CMAKE_SOURCE_DIR} /lib/std/io/reader.zig"
382
384
"${CMAKE_SOURCE_DIR} /lib/std/io/seekable_stream.zig"
383
385
"${CMAKE_SOURCE_DIR} /lib/std/io/writer.zig"
@@ -492,7 +494,7 @@ set(ZIG_STAGE2_SOURCES
492
494
"${CMAKE_SOURCE_DIR} /lib/std/special/compiler_rt/udivmodti4.zig"
493
495
"${CMAKE_SOURCE_DIR} /lib/std/special/compiler_rt/udivti3.zig"
494
496
"${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"
496
498
"${CMAKE_SOURCE_DIR} /lib/std/start.zig"
497
499
"${CMAKE_SOURCE_DIR} /lib/std/std.zig"
498
500
"${CMAKE_SOURCE_DIR} /lib/std/target.zig"
@@ -540,6 +542,8 @@ set(ZIG_STAGE2_SOURCES
540
542
"${CMAKE_SOURCE_DIR} /src/codegen/aarch64.zig"
541
543
"${CMAKE_SOURCE_DIR} /src/codegen/arm.zig"
542
544
"${CMAKE_SOURCE_DIR} /src/codegen/c.zig"
545
+ "${CMAKE_SOURCE_DIR} /src/codegen/llvm.zig"
546
+ "${CMAKE_SOURCE_DIR} /src/codegen/llvm/bindings.zig"
543
547
"${CMAKE_SOURCE_DIR} /src/codegen/riscv64.zig"
544
548
"${CMAKE_SOURCE_DIR} /src/codegen/spu-mk2.zig"
545
549
"${CMAKE_SOURCE_DIR} /src/codegen/wasm.zig"
@@ -558,11 +562,9 @@ set(ZIG_STAGE2_SOURCES
558
562
"${CMAKE_SOURCE_DIR} /src/link/MachO.zig"
559
563
"${CMAKE_SOURCE_DIR} /src/link/MachO/Trie.zig"
560
564
"${CMAKE_SOURCE_DIR} /src/link/Wasm.zig"
561
- "${CMAKE_SOURCE_DIR} /src/link/cbe .h"
565
+ "${CMAKE_SOURCE_DIR} /src/link/C/zig .h"
562
566
"${CMAKE_SOURCE_DIR} /src/link/msdos-stub.bin"
563
567
"${CMAKE_SOURCE_DIR} /src/liveness.zig"
564
- "${CMAKE_SOURCE_DIR} /src/llvm_backend.zig"
565
- "${CMAKE_SOURCE_DIR} /src/llvm_bindings.zig"
566
568
"${CMAKE_SOURCE_DIR} /src/main.zig"
567
569
"${CMAKE_SOURCE_DIR} /src/mingw.zig"
568
570
"${CMAKE_SOURCE_DIR} /src/musl.zig"
@@ -587,6 +589,12 @@ if(MSVC)
587
589
endif ()
588
590
endif ()
589
591
592
+ if (ZIG_OMIT_STAGE2)
593
+ set (ZIG_OMIT_STAGE2_BOOL "true" )
594
+ else ()
595
+ set (ZIG_OMIT_STAGE2_BOOL "false" )
596
+ endif ()
597
+
590
598
configure_file (
591
599
"${CMAKE_SOURCE_DIR} /src/stage1/config.h.in"
592
600
"${ZIG_CONFIG_H_OUT} "
0 commit comments