File tree 2 files changed +64
-2
lines changed
2 files changed +64
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Zig compiler
2
+ on :
3
+ push :
4
+ branches : [ '*' ]
5
+ pull_request :
6
+ branches : [ '*' ]
7
+ concurrency :
8
+ group : ${{ github.workflow }}-${{ github.ref_name }}
9
+ cancel-in-progress : true
10
+ jobs :
11
+ zig :
12
+ if : github.repository_owner == 'aws'
13
+ runs-on : ${{ matrix.os.name }}
14
+ strategy :
15
+ fail-fast : false
16
+ matrix :
17
+ os :
18
+ - name : windows-latest
19
+ target : x86_64-windows
20
+ - name : ubuntu-latest
21
+ target : x86_64-linux
22
+ - name : macos-latest
23
+ target : x86_64-macos
24
+ steps :
25
+ - name : Install NASM
26
+
27
+ - name : Checkout
28
+ uses : actions/checkout@v4
29
+ - name : Install zigcc
30
+ uses :
jiacai2050/[email protected]
31
+ with :
32
+ zig-version : 0.14.0
33
+ - name : Create toolchain
34
+ shell : bash
35
+ run : |
36
+ ZIGCC=`which zigcc`
37
+ ZIGCXX=`which zigcxx`
38
+ cat <<EOF > ./toolchain.cmake
39
+ set(CMAKE_C_COMPILER $(cygpath -w "${ZIGCC}"))
40
+ set(CMAKE_C_COMPILER_TARGET ${{ matrix.os.target }})
41
+ set(CMAKE_CXX_COMPILER $(cygpath -w "${ZIGXX}"))
42
+ set(CMAKE_CXX_COMPILER_TARGET ${{ matrix.os.target }})
43
+ set(CMAKE_GENERATOR "Ninja")
44
+ set(DISABLE_GO ON)
45
+ set(DISABLE_PERL ON)
46
+ set(CMAKE_VERBOSE_MAKEFILE ON)
47
+ set(CMAKE_MESSAGE_LOG_LEVEL TRACE)
48
+ EOF
49
+ - name : Setup CMake
50
+ shell : bash
51
+ run : |
52
+ printenv | sort
53
+ which zigcc
54
+ which zigcxx
55
+ cat ./toolchain.cmake
56
+ cmake '.' -B ./build -DCMAKE_TOOLCHAIN_FILE=./toolchain.cmake -DCMAKE_BUILD_TYPE=Release
57
+ - name : Build Project
58
+ shell : bash
59
+ run : |
60
+ cmake --build ./build --target all
Original file line number Diff line number Diff line change @@ -400,7 +400,9 @@ if(GCC OR CLANG)
400
400
else ()
401
401
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra" )
402
402
set (C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fvisibility=hidden -fno-common" )
403
- set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wno-newline-eof" )
403
+ if (NOT CMAKE_C_COMPILER MATCHES "zig" )
404
+ set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wno-newline-eof" )
405
+ endif ()
404
406
endif ()
405
407
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow" )
406
408
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wwrite-strings -Wformat-security -Wunused-result -Wno-overlength-strings" )
@@ -428,7 +430,7 @@ if(GCC OR CLANG)
428
430
endif ()
429
431
endif ()
430
432
431
- if (MINGW)
433
+ if (MINGW AND NOT CMAKE_C_COMPILER MATCHES "zig" )
432
434
# Some MinGW compilers set _WIN32_WINNT to an older version (Windows Server 2003)
433
435
# See: https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170
434
436
# Support Windows 7 and later.
You can’t perform that action at this time.
0 commit comments