diff --git a/.github/actions/configure-gcc/action.yml b/.github/actions/configure-gcc/action.yml new file mode 100644 index 0000000..7df4584 --- /dev/null +++ b/.github/actions/configure-gcc/action.yml @@ -0,0 +1,34 @@ +name: "Configure gcc" +description: "Installs and configures gcc in a specific version on an ubuntu image" +inputs: + gcc_version: + description: "The version of gcc to install. Must be the major version only." + required: true + enable_x86: + description: "Whether to enable x86 support." + default: "false" +runs: + using: "composite" + steps: + - name: Install g++ and multilib + shell: bash + run: | + apt-get update + apt-get install -y gcc-${{ inputs.gcc_version }} g++-${{ inputs.gcc_version }} ${ADDITIONAL_PACKAGES} + env: + ADDITIONAL_PACKAGES: ${{ case(inputs.enable_x86 == 'true', format('gcc-{0}-multilib g++-{0}-multilib', inputs.gcc_version), '') }} + + - name: Configure gcc + shell: bash + run: | + function register_gcc_version { + local version=$1 + local priority=$2 + + update-alternatives \ + --verbose \ + --install /usr/bin/gcc gcc /usr/bin/gcc-${version} ${priority} \ + --slave /usr/bin/g++ g++ /usr/bin/g++-${version} + } + + register_gcc_version ${{ inputs.gcc_version }} 100 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66c0e4a..9e25394 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true env: - PREMAKE_VERSION: "5.0.0-beta7" + PREMAKE_VERSION: "5.0.0-beta8" jobs: build-windows: @@ -89,17 +89,16 @@ jobs: configuration: - release arch: - - x86 - amd64 steps: - - name: Install g++ and multilib + - name: Enable i386 architecture + if: ${{ matrix.build_arch == 'x86' }} + run: dpkg --add-architecture i386 + + - name: Install base packages run: | apt-get update - apt-get install -y wget tar git make gcc-13 g++-13 gcc-13-multilib g++-13-multilib - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13 - update-alternatives --set gcc /usr/bin/gcc-13 - update-alternatives --set g++ /usr/bin/g++-13 + apt-get install -y wget tar git make curl - name: Check out files uses: actions/checkout@main @@ -108,12 +107,11 @@ jobs: fetch-depth: 0 lfs: false - - name: Install dependencies (x86) - if: matrix.arch == 'x86' - run: | - dpkg --add-architecture i386 - apt-get update - apt-get install -y gcc-13-multilib g++-13-multilib + - name: Configure gcc + uses: ./.github/actions/configure-gcc + with: + gcc_version: 14 + enable_x86: ${{ case(matrix.build_arch == 'x86', 'true', 'false') }} - name: Install Premake5 uses: diamante0018/setup-premake@master diff --git a/premake5.lua b/premake5.lua index ad2e115..b7a1205 100644 --- a/premake5.lua +++ b/premake5.lua @@ -102,7 +102,7 @@ if os.getenv("CI") then defines "CI" end -flags {"NoIncrementalLink", "NoMinimalRebuild", "MultiProcessorCompile", "No64BitChecks"} +multiprocessorcompile "On" filter "configurations:release" optimize "Size"