-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from abeimler/feature/cross-mingw
add mingw cross-compiler
- Loading branch information
Showing
30 changed files
with
421 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## base image | ||
FROM archlinux:base-devel as setup-cpp-arch-mingw | ||
|
||
COPY "./dist/legacy" "/usr/lib/setup-cpp/" | ||
|
||
# install git | ||
RUN pacman -Syuu --noconfirm && \ | ||
pacman-db-upgrade && \ | ||
pacman -S --noconfirm --needed git | ||
# install yay | ||
RUN useradd -m -G nobody -s /bin/bash yay && passwd -d yay && echo "yay ALL=(ALL) ALL" >> /etc/sudoers | ||
RUN git clone --depth 1 https://aur.archlinux.org/yay.git /opt/yay | ||
WORKDIR /opt/yay | ||
RUN chown -R yay:root . && chmod -R 775 . | ||
USER yay | ||
WORKDIR /opt/yay | ||
RUN makepkg -si --noprogressbar --noconfirm | ||
## clean up | ||
USER root | ||
WORKDIR / | ||
RUN rm -rf /opt/yay | ||
|
||
RUN pacman -Syuu --noconfirm && \ | ||
pacman-db-upgrade && \ | ||
# install nodejs | ||
pacman -S --noconfirm --needed nodejs npm && \ | ||
# install the compiler and tools | ||
node /usr/lib/setup-cpp/setup-cpp.js \ | ||
--compiler mingw \ | ||
--cmake true \ | ||
--ninja true \ | ||
--task true \ | ||
--vcpkg true \ | ||
--python true \ | ||
--make true \ | ||
--cppcheck true \ | ||
--gcovr true \ | ||
--doxygen true \ | ||
--ccache true && \ | ||
# arch cleanup | ||
pacman -Scc --noconfirm && \ | ||
rm -rf /var/cache/pacman/pkg/* && \ | ||
rm -rf /tmp/* | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
|
||
#### Cross Building (example) | ||
FROM setup-cpp-arch-mingw AS builder-mingw | ||
|
||
COPY ./dev/cpp_vcpkg_project /home/app | ||
WORKDIR /home/app | ||
RUN bash -c 'source ~/.cpprc \ | ||
&& task build_cross_mingw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
commandTests: | ||
- name: mingw c compiler | ||
command: x86_64-w64-mingw32-gcc | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-gcc.*"] | ||
- name: mingw c++ compiler | ||
command: x86_64-w64-mingw32-g++ | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-g\\+\\+*"] | ||
- name: powershell | ||
command: pwsh | ||
args: ["-Version"] | ||
expectedOutput: [".*PowerShell.*"] | ||
|
||
fileExistenceTests: | ||
- name: "vcpkg" | ||
path: "/root/vcpkg" | ||
shouldExist: true | ||
- name: "cross root" | ||
path: "/usr/x86_64-w64-mingw32" | ||
shouldExist: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## base image | ||
FROM fedora:38 as setup-cpp-fedora-mingw | ||
|
||
COPY "./dist/legacy" "/usr/lib/setup-cpp/" | ||
|
||
# install nodejs | ||
RUN dnf -y install nodejs npm && \ | ||
|
||
# install the compiler and tools | ||
node /usr/lib/setup-cpp/setup-cpp.js \ | ||
--compiler mingw \ | ||
--cmake true \ | ||
--ninja true \ | ||
--task true \ | ||
--vcpkg true \ | ||
--python true \ | ||
--make true \ | ||
--cppcheck true \ | ||
--gcovr true \ | ||
--doxygen true \ | ||
--ccache true \ | ||
--powershell true && \ | ||
# cleanup | ||
dnf clean all && \ | ||
rm -rf /tmp/* | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
|
||
#### Cross Building (example) | ||
FROM setup-cpp-fedora-mingw AS builder-mingw | ||
|
||
COPY ./dev/cpp_vcpkg_project /home/app | ||
WORKDIR /home/app | ||
RUN bash -c 'source ~/.cpprc \ | ||
&& task build_cross_mingw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
commandTests: | ||
- name: mingw c compiler | ||
command: x86_64-w64-mingw32-gcc | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-gcc.*"] | ||
- name: mingw c++ compiler | ||
command: x86_64-w64-mingw32-cpp | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-cpp.*"] | ||
- name: powershell | ||
command: pwsh | ||
args: ["-Version"] | ||
expectedOutput: [".*PowerShell.*"] | ||
|
||
fileExistenceTests: | ||
- name: "vcpkg" | ||
path: "/root/vcpkg" | ||
shouldExist: true | ||
- name: "cross root" | ||
path: "/usr/x86_64-w64-mingw32" | ||
shouldExist: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
dev/scripts/generate-docker-tests.mjs → ...ocker/__tests__/generate-docker-tests.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#### Base Image | ||
FROM ubuntu:22.04 as setup-cpp-ubuntu-mingw | ||
|
||
COPY "./dist/legacy" "/usr/lib/setup-cpp/" | ||
|
||
RUN apt-get update -qq && \ | ||
# install nodejs | ||
apt-get install -y --no-install-recommends nodejs npm && \ | ||
|
||
# install the compiler and tools | ||
node /usr/lib/setup-cpp/setup-cpp.js \ | ||
--nala true \ | ||
--compiler mingw \ | ||
--cmake true \ | ||
--ninja true \ | ||
--task true \ | ||
--vcpkg true \ | ||
--python true \ | ||
--make true \ | ||
--cppcheck true \ | ||
--gcovr true \ | ||
--doxygen true \ | ||
--ccache true \ | ||
--powershell true && \ | ||
# cleanup | ||
nala autoremove -y && \ | ||
nala autopurge -y && \ | ||
apt-get clean && \ | ||
nala clean --lists && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
rm -rf /tmp/* | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
|
||
#### Cross Building (example) | ||
FROM setup-cpp-ubuntu-mingw AS builder-mingw | ||
|
||
COPY ./dev/cpp_vcpkg_project /home/app | ||
WORKDIR /home/app | ||
RUN bash -c 'source ~/.cpprc \ | ||
&& task build_cross_mingw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
schemaVersion: 2.0.0 | ||
|
||
commandTests: | ||
- name: mingw c compiler | ||
command: x86_64-w64-mingw32-gcc | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-gcc.*"] | ||
- name: mingw c++ compiler | ||
command: x86_64-w64-mingw32-g++ | ||
args: ["--version"] | ||
expectedOutput: [".*x86_64-w64-mingw32-g\\+\\+*"] | ||
- name: powershell | ||
command: pwsh | ||
args: ["-Version"] | ||
expectedOutput: [".*PowerShell.*"] | ||
|
||
fileExistenceTests: | ||
- name: "vcpkg" | ||
path: "/root/vcpkg" | ||
shouldExist: true | ||
- name: "cross root" | ||
path: "/usr/x86_64-w64-mingw32" | ||
shouldExist: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#### Cross Building (example) | ||
FROM setup-cpp-arch-mingw AS builder-mingw | ||
|
||
COPY ./dev/cpp_vcpkg_project /home/app | ||
WORKDIR /home/app | ||
RUN bash -c 'source ~/.cpprc \ | ||
&& task build_cross_mingw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#### Cross Building (example) | ||
FROM setup-cpp-fedora-mingw AS builder-mingw | ||
|
||
COPY ./dev/cpp_vcpkg_project /home/app | ||
WORKDIR /home/app | ||
RUN bash -c 'source ~/.cpprc \ | ||
&& task build_cross_mingw' |
Oops, something went wrong.