build(premake): do not hardcode Premake5.lua to use clang

This commit is contained in:
Diavolo 2023-12-08 16:00:33 +01:00
parent 08c0710867
commit 2536651533
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
3 changed files with 10 additions and 7 deletions

View File

@ -99,7 +99,7 @@ jobs:
version: "5.0.0-beta2"
- name: Generate project files
run: premake5 gmake2
run: premake5 --cc=clang gmake2
- name: Set up problem matching
uses: ammaraskar/gcc-problem-matcher@master

View File

@ -12,4 +12,5 @@ This is the master server our clients use. It is based on the DP Master Server (
**IMPORTANT**
For Unix systems, you must use Clang to compile this project. You will also be required to install the LLVM C++ Standard library to run this program.
If you need to use another compiler, like GCC, you must use the [Mold](https://github.com/rui314/mold) linker. Additionally, you must tweak the Premake5.lua script as it is hardcoded to use Clang.
If you need to use another compiler, like GCC, you must use the [Mold](https://github.com/rui314/mold) linker. Additionally, you may have to tweak the Premake5.lua script.
I only support a few platforms, for more details see [build.yml](https://github.com/alterware/master-server/blob/master/.github/workflows/build.yml)

View File

@ -71,16 +71,18 @@ filter { "system:linux", "system:macosx" }
filter {}
if os.istarget("linux") then
filter { "platforms:arm64" }
filter { "toolset:clang*", "platforms:arm64" }
buildoptions "--target=arm64-linux-gnu"
linkoptions "--target=arm64-linux-gnu"
filter {}
buildoptions "-stdlib=libc++"
linkoptions "-stdlib=libc++"
filter { "toolset:clang*" }
buildoptions "-stdlib=libc++"
linkoptions "-stdlib=libc++"
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
-- always try to use lld. LD or Gold will not work
linkoptions "-fuse-ld=lld"
filter {}
end
filter { "system:macosx", "platforms:arm64" }