From 5dd9c6d85ba7cd1ab0ead592fe6c8fff90d4c473 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Wed, 27 Nov 2024 18:33:43 -0800 Subject: [PATCH] Remove MinGW from CI releases, only check that it builds --- .github/workflows/compilation.yml | 59 +++++------------------------- CMakeLists.txt | 8 ++-- cmake-scripts/BuildLanguages.cmake | 12 +++--- 3 files changed, 21 insertions(+), 58 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index a4286c38e..a96747c8e 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -280,12 +280,12 @@ jobs: path: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_macos14_arm.zip if-no-files-found: error - # Build windows package, release artifact (mingw-w64) + # Build MinGW, just so we know it still compiles # ----------------------------------------------------------------------------------------------- - build_windows: + check_mingw: needs: [unittest] - name: Build windows-amd64 (mingw-w64) + name: Check MinGW-w64 cross runs-on: ubuntu-latest steps: @@ -300,67 +300,26 @@ jobs: wget -q https://github.com/omf2097/openomf-win-build/archive/refs/heads/main.zip unzip -q main.zip && rm main.zip - - name: Generate Windows Release + - name: Build MinGW-w64 run: | - mkdir build-release && cd build-release - export WINEPATH="${GITHUB_WORKSPACE}/openomf-win-build-main/bin/" cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=release \ - -DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}/cmake-scripts/mingw-w64-toolchain.cmake" \ + --toolchain "cmake-scripts/mingw-w64-toolchain.cmake" \ -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \ -DCMAKE_INCLUDE_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/include/" \ -DCMAKE_LIBRARY_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/lib/" \ -DCMAKE_FIND_ROOT_PATH="${GITHUB_WORKSPACE}/openomf-win-build-main/" \ - -DOMF_COMMAND_WRAPPER="wine" \ + -DBUILD_LANGUAGES=OFF \ -DUSE_NATPMP=ON \ -DUSE_MINIUPNPC=ON \ - "${GITHUB_WORKSPACE}" - make -j $(getconf _NPROCESSORS_ONLN) - make -j $(getconf _NPROCESSORS_ONLN) install - cp ${GITHUB_WORKSPACE}/openomf-win-build-main/bin/*.dll release/openomf/ - - - name: Get short SHA - id: slug - run: echo "sha8=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT - - - name: Restore omf2097-assets.zip - id: cache-assets - uses: actions/cache/restore@v4 - with: - path: omf2097-assets.zip - key: omf2097-assets.zip - - - name: Download omf 2097 assets - if: steps.cache-assets.outputs.cache-hit != 'true' - run: wget -q "${{ env.OPENOMF_ASSETS_URL }}" - - - name: Cache omf2097-assets.zip - if: steps.cache-assets.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: omf2097-assets.zip - key: omf2097-assets.zip - - - name: Extract omf 2097 assets - run: unzip -j omf2097-assets.zip -d build-release/release/openomf/resources - - - name: Generate ZIP package - run: | - cd build-release/release - zip -r ${GITHUB_WORKSPACE}/openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip openomf - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64 - path: openomf_${{ env.OPENOMF_VERSION }}-${{ steps.slug.outputs.sha8 }}_windows_amd64.zip - if-no-files-found: error + -S . -B build + cmake --build build -j $(getconf _NPROCESSORS_ONLN) # Create a "latest" release # ----------------------------------------------------------------------------------------------- make_release: - needs: [build_windows, build_macos-arm, build_ubuntu, build_msvc] + needs: [check_mingw, build_macos-arm, build_ubuntu, build_msvc] if: github.ref == 'refs/heads/master' name: Make "latest" release diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d4c1d40f..90545193e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ OPTION(USE_SANITIZERS "Enable Asan and Ubsan" OFF) OPTION(USE_FATAL_SANITIZERS "Make Asan and Ubsan errors fatal" OFF) OPTION(USE_TIDY "Use clang-tidy for checks" OFF) OPTION(USE_FORMAT "Use clang-format for checks" OFF) +OPTION(BUILD_LANGUAGES "Build Language Files" ON) OPTION(USE_MINIUPNPC "Use miniupnpc for port forwarding" OFF) OPTION(USE_NATPMP "Use natpmp for port forwarding" OFF) @@ -292,9 +293,10 @@ add_dependencies(openomf copy_shaders) # Build tools if requested set(TOOL_TARGET_NAMES) -# always build languagetool, for BuildLanguages.cmake -add_executable(languagetool tools/languagetool/main.c) -list(APPEND TOOL_TARGET_NAMES languagetool) +if(BUILD_LANGUAGES OR USE_TOOLS) + add_executable(languagetool tools/languagetool/main.c) + list(APPEND TOOL_TARGET_NAMES languagetool) +endif() if (USE_TOOLS) add_executable(bktool tools/bktool/main.c tools/shared/animation_misc.c diff --git a/cmake-scripts/BuildLanguages.cmake b/cmake-scripts/BuildLanguages.cmake index ee5c4f7ce..7cde27d48 100644 --- a/cmake-scripts/BuildLanguages.cmake +++ b/cmake-scripts/BuildLanguages.cmake @@ -1,3 +1,7 @@ +if(NOT BUILD_LANGUAGES) + return() +endif() + # OMF 2097 Epic Challenge Arena set(LANG_STRCOUNT 1013) set(OMF_LANGS ENGLISH GERMAN) @@ -5,8 +9,6 @@ set(OMF_LANGS ENGLISH GERMAN) set(LANG2_STRCOUNT 1) set(OPENOMF_LANGS DANISH) -set(OMF_COMMAND_WRAPPER "" CACHE STRING "Optional wrapper to run languagetool with") - if(WIN32) set(LANGUAGE_INSTALL_PATH "openomf/resources/") else() @@ -24,7 +26,7 @@ foreach(LANG ${OMF_LANGS}) DEPENDS "${TXT2}" BYPRODUCTS "${DAT2}" COMMAND ${CMAKE_COMMAND} -E echo_append "${LANG}, " - COMMAND ${OMF_COMMAND_WRAPPER} "$" -i "${TXT2}" -o "${DAT2}" --check-count ${LANG2_STRCOUNT} + COMMAND "$" -i "${TXT2}" -o "${DAT2}" --check-count ${LANG2_STRCOUNT} ) install(FILES "${DAT2}" DESTINATION "${LANGUAGE_INSTALL_PATH}") endforeach() @@ -38,8 +40,8 @@ foreach(LANG ${OPENOMF_LANGS}) DEPENDS "${TXT}" "${TXT2}" BYPRODUCTS "${LNG}" "{LNG2}" COMMAND ${CMAKE_COMMAND} -E echo_append "${LANG}, " - COMMAND ${OMF_COMMAND_WRAPPER} "$" -i "${TXT}" -o "${LNG}" --check-count ${LANG_STRCOUNT} - COMMAND ${OMF_COMMAND_WRAPPER} "$" -i "${TXT2}" -o "${LNG2}" --check-count ${LANG2_STRCOUNT} + COMMAND "$" -i "${TXT}" -o "${LNG}" --check-count ${LANG_STRCOUNT} + COMMAND "$" -i "${TXT2}" -o "${LNG2}" --check-count ${LANG2_STRCOUNT} ) install(FILES "${LNG}" "${LNG2}" DESTINATION "${LANGUAGE_INSTALL_PATH}") endforeach()