File tree Expand file tree Collapse file tree 2 files changed +41
-8
lines changed Expand file tree Collapse file tree 2 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 18
18
include :
19
19
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, platform: linux-x64, cross: general }
20
20
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, platform: linux-arm64, cross: aarch64 }
21
- - { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: musl }
21
+ - { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: cross }
22
22
- { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: bsd }
23
23
- { os: macos-latest, target: x86_64-apple-darwin, platform: darwin-x64, cross: general }
24
24
- { os: macos-latest, target: aarch64-apple-darwin, platform: darwin-arm64, cross: general }
36
36
run : |
37
37
rustup target add ${{ matrix.target }}
38
38
cargo build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}
39
- - name : Build - musl
40
- if : ${{ matrix.cross == 'musl' }}
41
- run : |
42
- cargo install cross
43
- cross build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}
44
- - name : Build - aarch64
45
- if : ${{ matrix.cross == 'aarch64' }}
39
+ - name : Build - cross
40
+ if : ${{ matrix.cross == 'cross' }}
46
41
run : |
47
42
cargo install cross
48
43
cross build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}
Original file line number Diff line number Diff line change
1
+ use std:: { env, process:: Command } ;
2
+
1
3
fn main ( ) {
2
4
std:: env:: set_var ( "CC_LOG" , "1" ) ;
5
+ if cfg ! ( target_os = "linux" ) && cfg ! ( target_arch = "aarch64" ) {
6
+ std:: env:: set_var ( "CC" , "aarch64-linux-gnu-gcc" ) ;
7
+ std:: env:: set_var ( "CXX" , "aarch64-linux-gnu-g++" ) ;
8
+ print_compiler_version ( ) ;
9
+ }
10
+
3
11
build_lua ( ) ;
4
12
build_lua_seri ( ) ;
5
13
build_lpeglabel ( ) ;
6
14
cfg ! ( windows) . then ( || build_setfilemode ( ) ) ;
7
15
build_emmyluacodestyle ( ) ;
8
16
}
9
17
18
+ fn print_compiler_version ( ) {
19
+ if cfg ! ( target_os = "linux" ) {
20
+ let cc = env:: var ( "CC" ) . unwrap_or_else ( |_| {
21
+ "gcc" . to_string ( )
22
+ } ) ;
23
+
24
+ let cc_version = Command :: new ( & cc)
25
+ . arg ( "--version" )
26
+ . output ( )
27
+ . expect ( "Failed to execute CC command" ) ;
28
+ println ! (
29
+ "CC version:\n {}" ,
30
+ String :: from_utf8_lossy( & cc_version. stdout)
31
+ ) ;
32
+
33
+ let cxx = env:: var ( "CXX" ) . unwrap_or_else ( |_| {
34
+ "g++" . to_string ( )
35
+ } ) ;
36
+
37
+ let cxx_version = Command :: new ( & cxx)
38
+ . arg ( "--version" )
39
+ . output ( )
40
+ . expect ( "Failed to execute CXX command" ) ;
41
+ println ! (
42
+ "CXX version:\n {}" ,
43
+ String :: from_utf8_lossy( & cxx_version. stdout)
44
+ ) ;
45
+ }
46
+ }
47
+
10
48
fn build_lua ( ) {
11
49
cc:: Build :: new ( )
12
50
. include ( "3rd/lua" )
You can’t perform that action at this time.
0 commit comments