[CI, premake] GCC "progress"

Also move "NoBufferSecurityCheck" outside of Windows to improve performance for Linux. (linktimeoptimization leads to build errors)
This commit is contained in:
Margen67 2025-07-16 13:58:43 -07:00
parent 5e820b09c3
commit d8137a23ea
2 changed files with 88 additions and 35 deletions

View file

@ -65,8 +65,8 @@ jobs:
- name: Lint - name: Lint
run: ./xb lint --all run: ./xb lint --all
build: build-clang:
name: Build (LLVM ${{ matrix.LLVM_VERSION }}) name: Build (Clang ${{ matrix.LLVM_VERSION }})
needs: lint needs: lint
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
strategy: strategy:
@ -107,9 +107,48 @@ jobs:
path: artifacts path: artifacts
if-no-files-found: error if-no-files-found: error
# build-gcc:
# name: Build (GCC ${{ matrix.GCC_VERSION }})
# needs: lint
# runs-on: ubuntu-24.04
# strategy:
# fail-fast: false
# matrix:
# GCC_VERSION: [14]
# steps:
# - uses: actions/checkout@main
# with:
# fetch-depth: 0
# - name: Setup
# run: |
# sudo apt-get -y update
# sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev g++-${{ matrix.GCC_VERSION }}
# ./xb setup
# - name: Build
# env:
# CC: gcc-${{ matrix.GCC_VERSION }}
# CXX: g++-${{ matrix.GCC_VERSION }}
# # AR: ar
# run: ./xb build --config=Release
# - name: Prepare artifacts
# id: prepare_artifacts
# run: |
# if [ $(stat -c %s build/bin/Linux/Release/xenia_canary) -le 100000 ]; then
# echo "::error::Binary is too small."
# fi
# mkdir -p artifacts
# cp -r build/bin/Linux/Release/xenia_canary LICENSE artifacts
# - name: Upload xenia canary artifacts
# if: steps.prepare_artifacts.outcome == 'success'
# uses: actions/upload-artifact@main
# with:
# name: xenia_canary_linux_gcc
# path: artifacts
# if-no-files-found: error
create-release: create-release:
name: Create release name: Create release
needs: [lint, build] needs: [lint, build-clang] #build-gcc
if: | if: |
github.repository == 'xenia-canary/xenia-canary' && github.repository == 'xenia-canary/xenia-canary' &&
github.event.action != 'pull_request' && github.event.action != 'pull_request' &&

View file

@ -32,6 +32,7 @@ defines({
"USE_CPP17", -- Tabulate "USE_CPP17", -- Tabulate
}) })
cdialect("C17")
cppdialect("C++20") cppdialect("C++20")
exceptionhandling("On") exceptionhandling("On")
rtti("On") rtti("On")
@ -62,12 +63,12 @@ filter("configurations:Checked")
"DEBUG", "DEBUG",
}) })
filter({"configurations:Checked", "platforms:Windows"}) filter({"configurations:Checked", "platforms:Windows"}) -- "toolset:msc"
buildoptions({ buildoptions({
"/RTCsu", -- Full Run-Time Checks. "/RTCsu", -- Full Run-Time Checks.
}) })
filter({"configurations:Checked", "platforms:Linux"}) filter({"configurations:Checked or Debug", "platforms:Linux"})
defines({ defines({
"_GLIBCXX_DEBUG", -- libstdc++ debug mode "_GLIBCXX_DEBUG", -- libstdc++ debug mode
}) })
@ -80,10 +81,10 @@ filter("configurations:Debug")
"_NO_DEBUG_HEAP=1", "_NO_DEBUG_HEAP=1",
}) })
filter({"configurations:Debug", "platforms:Linux"}) --filter({"configurations:Debug", "platforms:Linux"})
defines({ -- defines({
"_GLIBCXX_DEBUG", -- make dbg symbols work on some distros -- "_GLIBCXX_DEBUG", -- make dbg symbols work on some distros
}) -- })
filter("configurations:Release") filter("configurations:Release")
runtime("Release") runtime("Release")
@ -93,6 +94,9 @@ filter("configurations:Release")
}) })
optimize("Speed") optimize("Speed")
symbols("Off") symbols("Off")
flags({
"NoBufferSecurityCheck"
})
inlining("Auto") inlining("Auto")
editandcontinue("Off") editandcontinue("Off")
-- Not using floatingpoint("Fast") - NaN checks are used in some places -- Not using floatingpoint("Fast") - NaN checks are used in some places
@ -102,12 +106,9 @@ filter("configurations:Release")
-- (such as constant propagation) emulation as predictable as possible, -- (such as constant propagation) emulation as predictable as possible,
-- including handling of specials since games make assumptions about them. -- including handling of specials since games make assumptions about them.
filter({"configurations:Release", "platforms:Windows"}) filter({"configurations:Release", "platforms:Windows"}) -- "toolset:msc"
linktimeoptimization("On") linktimeoptimization("On")
symbols("On") symbols("On")
flags({
"NoBufferSecurityCheck"
})
buildoptions({ buildoptions({
"/Gw", "/Gw",
"/Ob3", "/Ob3",
@ -118,9 +119,9 @@ filter("platforms:Linux")
system("linux") system("linux")
toolset("clang") toolset("clang")
vectorextensions("AVX2") vectorextensions("AVX2")
buildoptions({ --buildoptions({
-- "-mlzcnt", -- (don't) Assume lzcnt is supported. -- "-mlzcnt", -- (don't) Assume lzcnt is supported.
}) --})
pkg_config.all("gtk+-x11-3.0") pkg_config.all("gtk+-x11-3.0")
links({ links({
"stdc++fs", "stdc++fs",
@ -133,15 +134,23 @@ filter("platforms:Linux")
filter({"platforms:Linux", "kind:*App"}) filter({"platforms:Linux", "kind:*App"})
linkgroups("On") linkgroups("On")
filter({"platforms:Linux", "language:C++", "toolset:gcc"}) filter({"language:C++", "toolset:clang or gcc"}) -- "platforms:Linux"
disablewarnings({ disablewarnings({
"unused-result",
"deprecated-volatile",
"switch", "switch",
"deprecated-enum-enum-conversion", "attributes",
}) })
filter({"platforms:Linux", "toolset:gcc"}) filter({"language:C++", "toolset:gcc"}) -- "platforms:Linux"
disablewarnings({
"unused-result",
"volatile",
"template-id-cdtor",
"return-type",
"deprecated",
})
filter("toolset:gcc") -- "platforms:Linux"
removefatalwarnings("All") -- HACK
if ARCH == "ppc64" then if ARCH == "ppc64" then
buildoptions({ buildoptions({
"-m32", "-m32",
@ -151,20 +160,25 @@ filter({"platforms:Linux", "toolset:gcc"})
"-m32", "-m32",
"-mpowerpc64" "-mpowerpc64"
}) })
else
buildoptions({
"-fpermissive", -- HACK
})
linkoptions({
"-fpermissive", -- HACK
})
end end
filter({"platforms:Linux", "language:C++", "toolset:clang"}) filter({"language:C++", "toolset:clang"}) -- "platforms:Linux"
disablewarnings({ disablewarnings({
"deprecated-register", "deprecated-register",
"deprecated-volatile", "deprecated-volatile",
"switch",
"deprecated-enum-enum-conversion", "deprecated-enum-enum-conversion",
"attributes",
}) })
CLANG_BIN = os.getenv("CC", _OPTIONS["cc"]) or "clang" CLANG_BIN = os.getenv("CC") or _OPTIONS["cc"] or "clang"
if os.istarget("linux") and string.contains(CLANG_BIN, "clang") then if os.istarget("linux") and string.contains(CLANG_BIN, "clang") then
if tonumber(string.match(os.outputof(CLANG_BIN.." --version"), "version (%d%d)")) >= 20 then if tonumber(string.match(os.outputof(CLANG_BIN.." --version"), "version (%d%d)")) >= 20 then
filter({"platforms:Linux", "language:C++", "toolset:clang"}) filter({"language:C++", "toolset:clang"}) -- "platforms:Linux"
disablewarnings({ disablewarnings({
"deprecated-literal-operator", -- Needed only for tabulate "deprecated-literal-operator", -- Needed only for tabulate
"nontrivial-memcall", "nontrivial-memcall",
@ -172,10 +186,10 @@ if os.istarget("linux") and string.contains(CLANG_BIN, "clang") then
end end
end end
--filter({"platforms:Linux", "language:C++", "toolset:clang", "files:*.cc or *.cpp"}) filter({"language:C", "toolset:clang or gcc"}) -- "platforms:Linux"
-- buildoptions({ disablewarnings({
-- "-stdlib=libstdc++", "implicit-function-declaration",
-- }) })
filter("platforms:Android-*") filter("platforms:Android-*")
system("android") system("android")