From 10bb905ebda6a1bc5cae049bfc5ce33f0c86a774 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 4 Feb 2025 23:09:57 -0500 Subject: [PATCH 1/4] GitlabCI: use cmake --build to compile and not call directly Makefile files --- .gitlab/ci/jobs/alpine-3-gcc.yml | 8 ++++---- .gitlab/ci/jobs/batocera-arm64.yml | 4 ++-- .gitlab/ci/jobs/debian-oldstable-amd64.yml | 4 ++-- .gitlab/ci/jobs/debian-oldstable-arm64.yml | 4 ++-- .gitlab/ci/jobs/debian-stable-amd64.yml | 4 ++-- .gitlab/ci/jobs/debian-stable-arm64.yml | 4 ++-- .gitlab/ci/jobs/debian-stable-clang-amd64.yml | 8 ++++---- .gitlab/ci/jobs/debian-stable-i386.yml | 4 ++-- .gitlab/ci/jobs/debian-testing-gcc-amd64.yml | 4 ++-- .gitlab/ci/jobs/macos-arm64.yml | 8 ++++---- .gitlab/ci/jobs/macos-x86_64.yml | 8 ++++---- .gitlab/ci/jobs/windows-x64.yml | 6 ++++-- .gitlab/ci/jobs/windows-x86.yml | 10 ++++------ 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.gitlab/ci/jobs/alpine-3-gcc.yml b/.gitlab/ci/jobs/alpine-3-gcc.yml index 522b88ae3..72994d405 100644 --- a/.gitlab/ci/jobs/alpine-3-gcc.yml +++ b/.gitlab/ci/jobs/alpine-3-gcc.yml @@ -15,8 +15,8 @@ Alpine 3 GCC: artifacts: paths: - - "build.alpine3/bin/" - - "build.alpine3/src/config.h" + - "build.cmake/bin/" + - "build.cmake/src/config.h" expose_as: "Apline-3" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-Apline-3" @@ -111,7 +111,7 @@ Alpine 3 GCC: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.alpine3 -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_EXECINFO=NO -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_EXECINFO=NO -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -119,7 +119,7 @@ Alpine 3 GCC: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.alpine3 --keep-going || make --directory=build.alpine3 --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/batocera-arm64.yml b/.gitlab/ci/jobs/batocera-arm64.yml index c3b586584..3dcd73a0e 100644 --- a/.gitlab/ci/jobs/batocera-arm64.yml +++ b/.gitlab/ci/jobs/batocera-arm64.yml @@ -32,7 +32,7 @@ batocera:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -40,7 +40,7 @@ batocera:arm64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-oldstable-amd64.yml b/.gitlab/ci/jobs/debian-oldstable-amd64.yml index ad69dc8dd..231e8485d 100644 --- a/.gitlab/ci/jobs/debian-oldstable-amd64.yml +++ b/.gitlab/ci/jobs/debian-oldstable-amd64.yml @@ -34,7 +34,7 @@ Debian oldstable:amd64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -42,7 +42,7 @@ Debian oldstable:amd64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-oldstable-arm64.yml b/.gitlab/ci/jobs/debian-oldstable-arm64.yml index 24db9c807..76d401309 100644 --- a/.gitlab/ci/jobs/debian-oldstable-arm64.yml +++ b/.gitlab/ci/jobs/debian-oldstable-arm64.yml @@ -34,7 +34,7 @@ Debian oldstable:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -42,7 +42,7 @@ Debian oldstable:arm64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-stable-amd64.yml b/.gitlab/ci/jobs/debian-stable-amd64.yml index a39344db8..ed1f5ce23 100644 --- a/.gitlab/ci/jobs/debian-stable-amd64.yml +++ b/.gitlab/ci/jobs/debian-stable-amd64.yml @@ -40,7 +40,7 @@ Debian stable:amd64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -48,7 +48,7 @@ Debian stable:amd64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-stable-arm64.yml b/.gitlab/ci/jobs/debian-stable-arm64.yml index 52e6e8603..b0f02dd39 100644 --- a/.gitlab/ci/jobs/debian-stable-arm64.yml +++ b/.gitlab/ci/jobs/debian-stable-arm64.yml @@ -41,7 +41,7 @@ Debian stable:arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -49,7 +49,7 @@ Debian stable:arm64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-stable-clang-amd64.yml b/.gitlab/ci/jobs/debian-stable-clang-amd64.yml index 4686c1849..c40998e17 100644 --- a/.gitlab/ci/jobs/debian-stable-clang-amd64.yml +++ b/.gitlab/ci/jobs/debian-stable-clang-amd64.yml @@ -9,8 +9,8 @@ Debian stable Clang: artifacts: paths: - - "build.clang/bin/" - - "build.clang/src/config.h" + - "build.cmake/bin/" + - "build.cmake/src/config.h" expose_as: "clang" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" @@ -41,7 +41,7 @@ Debian stable Clang: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.clang -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -G "Unix Makefiles" + - cmake -B build.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_USE_LIBGME:BOOL=OFF -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -49,7 +49,7 @@ Debian stable Clang: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.clang --keep-going || make --directory=build.clang --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-stable-i386.yml b/.gitlab/ci/jobs/debian-stable-i386.yml index ad4dcbb4f..970b92a69 100644 --- a/.gitlab/ci/jobs/debian-stable-i386.yml +++ b/.gitlab/ci/jobs/debian-stable-i386.yml @@ -40,7 +40,7 @@ Debian stable:i386: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -48,7 +48,7 @@ Debian stable:i386: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml b/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml index 7efb6c62d..72bfdc3e3 100644 --- a/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml +++ b/.gitlab/ci/jobs/debian-testing-gcc-amd64.yml @@ -41,7 +41,7 @@ Debian testing GCC: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -G "Unix Makefiles" + - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DSRB2_CONFIG_USE_GME:BOOL=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -49,7 +49,7 @@ Debian testing GCC: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/macos-arm64.yml b/.gitlab/ci/jobs/macos-arm64.yml index a9e31773e..415d1f382 100644 --- a/.gitlab/ci/jobs/macos-arm64.yml +++ b/.gitlab/ci/jobs/macos-arm64.yml @@ -9,8 +9,8 @@ osxcross arm64: artifacts: paths: - - "build.osxcross/bin/" - - "build.osxcross/src/config.h" + - "build.cmake/bin/" + - "build.cmake/src/config.h" expose_as: "Mac arm64" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" @@ -30,7 +30,7 @@ osxcross arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles" + - cmake -B build.cmake --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -38,7 +38,7 @@ osxcross arm64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/macos-x86_64.yml b/.gitlab/ci/jobs/macos-x86_64.yml index 525a919c8..4905c2e09 100644 --- a/.gitlab/ci/jobs/macos-x86_64.yml +++ b/.gitlab/ci/jobs/macos-x86_64.yml @@ -29,8 +29,8 @@ osxcross x86_64: artifacts: paths: - - "build.osxcross/bin/" - - "build.osxcross/src/config.h" + - "build.cmake/bin/" + - "build.cmake/src/config.h" expose_as: "Mac x86_64" name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" @@ -71,7 +71,7 @@ osxcross x86_64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.osxcross --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -G "Unix Makefiles" + - cmake -B build.cmake --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -79,7 +79,7 @@ osxcross x86_64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.osxcross --keep-going || make --directory=build.osxcross --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/windows-x64.yml b/.gitlab/ci/jobs/windows-x64.yml index e5accf926..ca7f4ae08 100644 --- a/.gitlab/ci/jobs/windows-x64.yml +++ b/.gitlab/ci/jobs/windows-x64.yml @@ -16,6 +16,8 @@ Windows x64: variables: PREFIX: x86_64-w64-mingw32 + CC: /usr/lib/ccache/x86_64-w64-mingw32-gcc + CXX: /usr/lib/ccache/x86_64-w64-mingw32-g++ script: - - | @@ -37,7 +39,7 @@ Windows x64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake + - cmake -B build.cmake -DSRB2_USE_CCACHE=NO -DSRB2_CONFIG_ERRORMODE=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-mingw-static -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/toolchains/mingw.cmake - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -45,7 +47,7 @@ Windows x64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - make --directory=build.cmake --keep-going || make --directory=build.cmake --keep-going + - cmake --build build.cmake --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" diff --git a/.gitlab/ci/jobs/windows-x86.yml b/.gitlab/ci/jobs/windows-x86.yml index f983c8287..c8293eb7d 100644 --- a/.gitlab/ci/jobs/windows-x86.yml +++ b/.gitlab/ci/jobs/windows-x86.yml @@ -40,8 +40,8 @@ Windows x86: variables: PREFIX: i686-w64-mingw32 - CC: /usr/bin/i686-w64-mingw32-gcc-posix - CXX: /usr/bin/i686-w64-mingw32-g++-posix + CC: /usr/lib/ccache/i686-w64-mingw32-gcc + CXX: /usr/lib/ccache/i686-w64-mingw32-g++ script: - | @@ -84,9 +84,7 @@ Windows x86: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - # cmake - echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake --preset ninja-x86_mingw_static_vcpkg-debug -G "Unix Makefiles" -DSRB2_USE_CCACHE=YES -DSRB2_CONFIG_ERRORMODE=ON -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake + - cmake -B build.cmake --preset ninja-x86_mingw_static_vcpkg-debug -DSRB2_USE_CCACHE=NO -DSRB2_CONFIG_ERRORMODE=ON - | # cmake echo -e "\e[0Ksection_end:`date +%s`:cmake\r\e[0K" @@ -94,7 +92,7 @@ Windows x86: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - cmake --build --preset ninja-x86_mingw_static_vcpkg-debug --parallel 1 -- --keep-going || cmake --build --preset ninja-x86_mingw_static_vcpkg-debug --parallel 1 -- --keep-going + - cmake -build build.cmake --parallel 1 --verbose --preset ninja-x86_mingw_static_vcpkg-debug - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" From ec3edcc6c9b014da4ba5e0cfa331163647c83fc9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 6 Feb 2025 12:25:27 -0500 Subject: [PATCH 2/4] GitlabCI: install static version of curl, libopenmpt,libsdl2-mixer,libpng and libxmp for macs --- .gitlab/ci/jobs/macos-arm64.yml | 3 ++- .gitlab/ci/jobs/macos-x86_64.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/jobs/macos-arm64.yml b/.gitlab/ci/jobs/macos-arm64.yml index 415d1f382..45a865992 100644 --- a/.gitlab/ci/jobs/macos-arm64.yml +++ b/.gitlab/ci/jobs/macos-arm64.yml @@ -22,7 +22,8 @@ osxcross arm64: - - | # apt_development echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" - - osxcross-macports install --arm64 curl libopenmpt libsdl2_mixer + - osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile + - osxcross-macports install --static --arm64 curl libsdl2_mixer libpng - | # apt_development echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" diff --git a/.gitlab/ci/jobs/macos-x86_64.yml b/.gitlab/ci/jobs/macos-x86_64.yml index 4905c2e09..a015f41d8 100644 --- a/.gitlab/ci/jobs/macos-x86_64.yml +++ b/.gitlab/ci/jobs/macos-x86_64.yml @@ -63,7 +63,8 @@ osxcross x86_64: - - | # apt_development echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" - - osxcross-macports install curl libopenmpt libsdl2_mixer + - osxcross-macports install libxmp wavpack libopenmpt opusfile + - osxcross-macports install --static curl libsdl2_mixer libpng - | # apt_development echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" From 1e47cb2061bb57b19920221faf05e34ddd995bad Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 6 Feb 2025 18:51:49 -0500 Subject: [PATCH 3/4] GitlabCI: checks if osxcross arm64 build fails --- .gitlab/ci/jobs/macos-arm64.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab/ci/jobs/macos-arm64.yml b/.gitlab/ci/jobs/macos-arm64.yml index 45a865992..218865526 100644 --- a/.gitlab/ci/jobs/macos-arm64.yml +++ b/.gitlab/ci/jobs/macos-arm64.yml @@ -3,10 +3,6 @@ osxcross arm64: stage: build - when: manual - - allow_failure: true - artifacts: paths: - "build.cmake/bin/" From 620bb5054f10d49d9ed8f834561826b5f43f34a0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 6 Feb 2025 22:12:22 -0500 Subject: [PATCH 4/4] GitlabCI: use lipo to create universal darwin binary --- .gitlab-ci.yml | 1 + .gitlab/ci/jobs/macos-arm64.yml | 24 ++++++--- .gitlab/ci/jobs/macos-x86_64.yml | 25 ++++++--- .gitlab/ci/jobs/osxccross-universal.yml | 67 +++++++++++++++++++++++++ 4 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 .gitlab/ci/jobs/osxccross-universal.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29f5ef5ff..14c36213e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ variables: stages: - build + - osxcross default: interruptible: true diff --git a/.gitlab/ci/jobs/macos-arm64.yml b/.gitlab/ci/jobs/macos-arm64.yml index 218865526..1c89000c2 100644 --- a/.gitlab/ci/jobs/macos-arm64.yml +++ b/.gitlab/ci/jobs/macos-arm64.yml @@ -5,10 +5,11 @@ osxcross arm64: artifacts: paths: - - "build.cmake/bin/" - - "build.cmake/src/config.h" + - "build.arm64/bin/" + - "build.arm64/dist/arm64.h" + - "build.arm64/src/config.h" expose_as: "Mac arm64" - name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" + name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-arm64-apple-darwin21.4" variables: OSXCROSS_HOST: arm64-apple-darwin21.4 @@ -18,8 +19,8 @@ osxcross arm64: - - | # apt_development echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" - - osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile - - osxcross-macports install --static --arm64 curl libsdl2_mixer libpng + - osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile || osxcross-macports install --arm64 libxmp wavpack libopenmpt opusfile + - osxcross-macports install --static --arm64 curl libsdl2_mixer libpng || osxcross-macports install --static --arm64 curl libsdl2_mixer libpng - | # apt_development echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" @@ -27,7 +28,7 @@ osxcross arm64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF + - cmake -B build.arm64 --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_FORCE_NO_MS_BITFIELDS:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -DSRB2_SDL2_EXE_NAME=srb2_$CI_PIPELINE_ID - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -35,7 +36,16 @@ osxcross arm64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - cmake --build build.cmake --parallel 1 --verbose + - cmake --build build.arm64 --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + + - - | + # copy config.h + echo -e "\e[0Ksection_start:`date +%s`:copy[collapsed=false]\r\e[0KCopying config.h" + - mkdir --parents --verbose build.arm64/dist + - cp --reflink=auto --sparse=always --verbose build.arm64/src/config.h build.arm64/dist/arm64.h + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K" diff --git a/.gitlab/ci/jobs/macos-x86_64.yml b/.gitlab/ci/jobs/macos-x86_64.yml index a015f41d8..d40ae65f6 100644 --- a/.gitlab/ci/jobs/macos-x86_64.yml +++ b/.gitlab/ci/jobs/macos-x86_64.yml @@ -29,10 +29,11 @@ osxcross x86_64: artifacts: paths: - - "build.cmake/bin/" - - "build.cmake/src/config.h" + - "build.x86_64/bin/" + - "build.x86_64/dist/x86_64.h" + - "build.x86_64/src/config.h" expose_as: "Mac x86_64" - name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-clang" + name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-x86_64-apple-darwin21.4" variables: OSXCROSS_HOST: x86_64-apple-darwin21.4 @@ -63,8 +64,8 @@ osxcross x86_64: - - | # apt_development echo -e "\e[0Ksection_start:`date +%s`:macports_development[collapsed=true]\r\e[0KInstalling development packages" - - osxcross-macports install libxmp wavpack libopenmpt opusfile - - osxcross-macports install --static curl libsdl2_mixer libpng + - osxcross-macports install libxmp wavpack libopenmpt opusfile || osxcross-macports install libxmp wavpack libopenmpt opusfile + - osxcross-macports install --static curl libsdl2_mixer libpng || osxcross-macports install --static curl libsdl2_mixer libpng - | # apt_development echo -e "\e[0Ksection_end:`date +%s`:macports_development\r\e[0K" @@ -72,7 +73,7 @@ osxcross x86_64: - - | # cmake echo -e "\e[0Ksection_start:`date +%s`:cmake[collapsed=false]\r\e[0KBuilding Makefiles" - - cmake -B build.cmake --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF + - cmake -B build.x86_64 --toolchain /osxcross/toolchain.cmake -DCPM_USE_LOCAL_PACKAGES:BOOL=ON -DOPENMPT_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/include" -DSDL2_INCLUDE_DIR:PATH="/osxcross/macports/pkgs/opt/local/lib" -DSRB2_CONFIG_ENABLE_TESTS:BOOL=OFF -DSRB2_CONFIG_SYSTEM_LIBRARIES:BOOL=ON -DSRB2_CONFIG_USE_GME:BOOL=OFF -DSRB2_SDL2_EXE_NAME=srb2_$CI_PIPELINE_ID - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" @@ -80,11 +81,21 @@ osxcross x86_64: - - | # make echo -e "\e[0Ksection_start:`date +%s`:make[collapsed=false]\r\e[0KCompiling SRB2" - - cmake --build build.cmake --parallel 1 --verbose + - cmake --build build.x86_64 --parallel 1 --verbose - | # make echo -e "\e[0Ksection_end:`date +%s`:make\r\e[0K" + - - | + # copy config.h + echo -e "\e[0Ksection_start:`date +%s`:copy[collapsed=false]\r\e[0KCopying config.h" + - mkdir --parents --verbose build.x86_64/dist + - cp --reflink=auto --sparse=always --verbose build.x86_64/src/config.h build.x86_64/dist/x86_64.h + - | + # make + echo -e "\e[0Ksection_end:`date +%s`:copy\r\e[0K" + + after_script: - - | # apt_clean diff --git a/.gitlab/ci/jobs/osxccross-universal.yml b/.gitlab/ci/jobs/osxccross-universal.yml new file mode 100644 index 000000000..841151f60 --- /dev/null +++ b/.gitlab/ci/jobs/osxccross-universal.yml @@ -0,0 +1,67 @@ +osxcross universal: + image: git.do.srb2.org:5050/stjr/srb2ci/srb2ci:stable + + dependencies: + - osxcross arm64 + - osxcross x86_64 + needs: + - job: osxcross arm64 + - job: osxcross x86_64 + + stage: osxcross + + artifacts: + paths: + - "dist/bin" + - "dist/src" + expose_as: "Mac Universal" + name: "$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-lipo-apple-darwin21.4" + + script: + - - | + # mkdir + echo -e "\e[0Ksection_start:`date +%s`:mkdir[collapsed=true]\r\e[0KMaking dist folder" + mkdir --parents --verbose dist/src dist/bin + - | + # mkdir + echo -e "\e[0Ksection_end:`date +%s`:mkdir\r\e[0K" + + - - | + # copy-config + echo -e "\e[0Ksection_start:`date +%s`:x86_64-config[collapsed=true]\r\e[0KCopying x86_64 config" + - cp --reflink=auto --sparse=always --verbose --target-directory=dist/src/ build.*/dist/*.h + - | + # x86_64-config + echo -e "\e[0Ksection_end:`date +%s`:x86_64-config\r\e[0K" + + - - | + # copy-build + echo -e "\e[0Ksection_start:`date +%s`:copy-build[collapsed=true]\r\e[0KCopying ALL build" + - cp --reflink=auto --sparse=always --recursive --verbose --target-directory=dist/ build.*/bin/ + - | + # copy-build + echo -e "\e[0Ksection_end:`date +%s`:copy-build\r\e[0K" + + - - | + # link-build + echo -e "\e[0Ksection_start:`date +%s`:link-build[collapsed=true]\r\e[0KLinking universal build" + - lipo -create -output dist/bin/srb2_$CI_PIPELINE_ID.app/Contents/MacOS/srb2_$CI_PIPELINE_ID build.*/bin/srb2_$CI_PIPELINE_ID.app/Contents/MacOS/srb2_$CI_PIPELINE_ID + - | + # universal-build + echo -e "\e[0Ksection_end:`date +%s`:link-build\r\e[0K" + + - - | + # arm64-verify + echo -e "\e[0Ksection_start:`date +%s`:arm64-verify[collapsed=true]\r\e[0KVerifying arm64" + - lipo dist/bin/srb2_$CI_PIPELINE_ID.app/Contents/MacOS/srb2_$CI_PIPELINE_ID -verify_arch arm64 + - | + # arm64-verify + echo -e "\e[0Ksection_end:`date +%s`:arm64-verify\r\e[0K" + + - - | + # x86_64-verify + echo -e "\e[0Ksection_start:`date +%s`:x86_64-verify[collapsed=true]\r\e[0KVerifying x86_64" + - lipo dist/bin/srb2_$CI_PIPELINE_ID.app/Contents/MacOS/srb2_$CI_PIPELINE_ID -verify_arch x86_64 + - | + # x86_64-verify + echo -e "\e[0Ksection_end:`date +%s`:x86_64-verify\r\e[0K"