Improve clang default toolset on BSD

The gmake action has a separate idea as to what the default toolset
should be, add that to the patch fixing the default for BSD.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2025-06-14 06:53:16 +02:00
parent 8b98a7a27c
commit ead2fbc115
2 changed files with 34 additions and 7 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ set -e
cd "$(dirname "$0")"
PV=5.0.0-beta6
LIB_VERSION=${PV}+wfg0
LIB_VERSION=${PV}+wfg1
fetch()
{
@@ -1,4 +1,4 @@
From 4f02eba3f7279de3693aa2405e1c0700fcade23a Mon Sep 17 00:00:00 2001
From a41fa4e94b479edfbab5312f68277f2573893510 Mon Sep 17 00:00:00 2001
From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Date: Mon, 25 Nov 2024 15:57:10 +0100
Subject: [PATCH] Make clang default toolset for *BSD
@@ -7,14 +7,29 @@ https://github.com/premake/premake-core/issues/2338
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
---
src/_premake_init.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
modules/gmake/_preload.lua | 2 +-
src/_premake_init.lua | 2 +-
src/base/_foundation.lua | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/gmake/_preload.lua b/modules/gmake/_preload.lua
index 1ff42b77..e3e9a109 100644
--- a/modules/gmake/_preload.lua
+++ b/modules/gmake/_preload.lua
@@ -13,7 +13,7 @@
local function defaultToolset()
local target = os.target()
- if target == p.MACOSX then
+ if target == p.MACOSX or target == p.BSD then
return "clang"
elseif target == p.EMSCRIPTEN then
return "emcc"
diff --git a/src/_premake_init.lua b/src/_premake_init.lua
index 69f05fc9..c42c514f 100644
index 4a6f080e..672252e5 100644
--- a/src/_premake_init.lua
+++ b/src/_premake_init.lua
@@ -1441,7 +1441,7 @@
@@ -1439,7 +1439,7 @@
filter { "kind:SharedLib", "system:not Windows" }
pic "On"
@@ -23,6 +38,18 @@ index 69f05fc9..c42c514f 100644
toolset "clang"
filter { "system:emscripten" }
diff --git a/src/base/_foundation.lua b/src/base/_foundation.lua
index 9a09753e..0f7b7f9a 100644
--- a/src/base/_foundation.lua
+++ b/src/base/_foundation.lua
@@ -26,6 +26,7 @@
-- Define some commonly used symbols, for future-proofing.
--
+ premake.BSD = "bsd"
premake.C = "C"
premake.CLANG = "clang"
premake.CONSOLEAPP = "ConsoleApp"
--
2.45.2
2.49.0