Skip to content

Commit

Permalink
build(premake): do not hardcode Premake5.lua to use clang (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
diamante0018 authored Dec 8, 2023
1 parent 08c0710 commit 9ae077d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 7 additions & 5 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 9ae077d

Please sign in to comment.