Skip to content

Commit f84c114

Browse files
authored
Auto merge of #342 - sagudev:mmake, r=jdm
Fix makefile style and fallback to general cc commands & temp windows builds fix - use `cc` instead of `gcc` and `c++` instead of `g++` for fallback on linux - format makefile - pin window ci to rust 1.66 due to #334 - update nightly version used for UWP
2 parents 0b37834 + d23ff38 commit f84c114

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ jobs:
7373
.\install.ps1 -RunAsAdmin
7474
scoop install [email protected] --global
7575
echo "C:\ProgramData\scoop\shims;C:\Users\runneradmin\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
76-
- uses: dtolnay/rust-toolchain@stable
76+
- uses: dtolnay/rust-toolchain@1.66
7777
- name: Build uwp
7878
if: contains(matrix.target, 'uwp')
7979
shell: cmd
8080
env:
81+
TOOLCHAIN: nightly-2023-02-02
8182
MOZTOOLS_PATH: 'C:\mozilla-build\msys\bin;C:\mozilla-build\bin'
8283
AUTOCONF: "C:/mozilla-build/msys/local/bin/autoconf-2.13"
8384
LINKER: "lld-link.exe"
@@ -87,11 +88,11 @@ jobs:
8788
PYTHON3: "C:\\mozilla-build\\python3\\python3.exe"
8889
LIBCLANG_PATH: "C:\\ProgramData\\scoop\\apps\\llvm\\current\\lib"
8990
run: |
90-
rustup install nightly-2022-11-20
91-
rustup default nightly-2022-11-20
92-
rustup component add rust-src
91+
rustup install ${{ env.TOOLCHAIN }}
92+
rustup default ${{ env.TOOLCHAIN }}
93+
rustup component add rust-src --toolchain ${{ env.TOOLCHAIN }}-x86_64-pc-windows-msvc
9394
rustc --version --verbose
94-
cargo build --verbose ${{ matrix.features }} -Z build-std=std,panic_abort --target ${{ matrix.target }}
95+
cargo +${{ env.TOOLCHAIN }} build --verbose ${{ matrix.features }} -Z build-std=std,panic_abort --target ${{ matrix.target }}
9596
- name: Build Windows
9697
if: contains(matrix.target, 'uwp') != true
9798
shell: cmd

mozjs/makefile.cargo

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,37 +79,37 @@ ifneq ($(HOST),$(TARGET))
7979
endif
8080
endif
8181

82-
ifeq ($(WINDOWS),)
83-
CC ?= $(TARGET)-gcc
84-
CPP ?= $(TARGET)-gcc -E
85-
CXX ?= $(TARGET)-g++
86-
AR ?= $(TARGET)-ar
87-
CONFIGURE_FLAGS += --target=$(TARGET) --disable-gold
88-
endif
82+
ifeq ($(WINDOWS),)
83+
CC ?= $(TARGET)-gcc
84+
CPP ?= $(TARGET)-gcc -E
85+
CXX ?= $(TARGET)-g++
86+
AR ?= $(TARGET)-ar
87+
CONFIGURE_FLAGS += --target=$(TARGET) --disable-gold
88+
endif
8989

9090
else
9191

92-
ifeq (,$(WINDOWS))
93-
ifeq (freebsd,$(findstring freebsd,$(TARGET)))
94-
# Does not symlink clang as "gcc" like macOS does
95-
CC ?= clang
96-
CPP ?= clang -E
97-
CXX ?= clang++
98-
else
99-
CC ?= gcc
100-
CPP ?= gcc -E
101-
CXX ?= g++
102-
endif
103-
AR ?= ar
92+
ifeq (,$(WINDOWS))
93+
ifeq (freebsd,$(findstring freebsd,$(TARGET)))
94+
# Does not symlink clang as "gcc" like macOS does
95+
CC ?= clang
96+
CPP ?= clang -E
97+
CXX ?= clang++
98+
else
99+
CC ?= cc
100+
CPP ?= cc -E
101+
CXX ?= c++
102+
endif
103+
AR ?= ar
104104

105-
# check if python2 is a valid Python executable, otherwise fall back to python
106-
ifeq (, $(findstring Python 2.,$(shell python2 --version 2> /dev/null)))
107-
PYTHON ?= python2
108-
else
109-
PYTHON ?= python
110-
endif
105+
# check if python2 is a valid Python executable, otherwise fall back to python
106+
ifeq (, $(findstring Python 2.,$(shell python2 --version 2> /dev/null)))
107+
PYTHON ?= python2
108+
else
109+
PYTHON ?= python
110+
endif
111111

112-
endif
112+
endif
113113

114114
endif
115115

0 commit comments

Comments
 (0)