summaryrefslogtreecommitdiffstats
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua55
1 files changed, 45 insertions, 10 deletions
diff --git a/premake5.lua b/premake5.lua
index 7fc21907..72ff4d09 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -28,13 +28,18 @@ newoption {
}
newoption {
+ trigger = "with-lto",
+ description = "Build with link time optimization"
+}
+
+newoption {
trigger = "no-git-hash",
description = "Don't print git commit hash into binary"
}
newoption {
- trigger = "lto",
- description = "Use link time optimization"
+ trigger = "no-full-paths",
+ description = "Don't print full paths into binary"
}
if(_OPTIONS["with-librw"]) then
@@ -114,7 +119,7 @@ workspace "re3"
filter "configurations:not Debug"
defines { "NDEBUG" }
optimize "Speed"
- if(_OPTIONS["lto"]) then
+ if(_OPTIONS["with-lto"]) then
flags { "LinkTimeOptimization" }
end
@@ -142,12 +147,18 @@ workspace "re3"
filter { "platforms:*arm*" }
architecture "ARM"
- filter { "platforms:macosx-arm64-*" }
+ filter { "platforms:macosx-arm64-*", "files:**.cpp"}
buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" }
- filter { "platforms:macosx-amd64-*" }
+ filter { "platforms:macosx-arm64-*", "files:**.c"}
+ buildoptions { "-target", "arm64-apple-macos11" }
+
+ filter { "platforms:macosx-amd64-*", "files:**.cpp"}
buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" }
+ filter { "platforms:macosx-amd64-*", "files:**.c"}
+ buildoptions { "-target", "x86_64-apple-macos10.12" }
+
filter { "platforms:*librw_d3d9*" }
defines { "RW_D3D9" }
if(not _OPTIONS["with-librw"]) then
@@ -207,13 +218,19 @@ project "librw"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
- filter "platforms:macosx*"
- -- Support MacPorts and Homebrew
+ -- Support MacPorts and Homebrew
+ filter "platforms:macosx-arm64-*"
+ includedirs { "/opt/local/include" }
+ includedirs {"/opt/homebrew/include" }
+ libdirs { "/opt/local/lib" }
+ libdirs { "/opt/homebrew/lib" }
+
+ filter "platforms:macosx-amd64-*"
includedirs { "/opt/local/include" }
includedirs {"/usr/local/include" }
libdirs { "/opt/local/lib" }
libdirs { "/usr/local/lib" }
-
+
filter "platforms:*gl3_glfw*"
staticruntime "off"
@@ -327,6 +344,10 @@ project "re3"
linkoptions "/SAFESEH:NO"
characterset ("MBCS")
targetextension ".exe"
+ if(_OPTIONS["no-full-paths"]) then
+ usefullpaths "off"
+ linkoptions "/PDBALTPATH:%_PDB%"
+ end
if(_OPTIONS["with-librw"]) then
-- external librw is dynamic
staticruntime "on"
@@ -366,6 +387,12 @@ project "re3"
filter "platforms:macosx*oal"
links { "openal", "mpg123", "sndfile", "pthread" }
+
+ filter "platforms:macosx-arm64-*oal"
+ includedirs { "/opt/homebrew/opt/openal-soft/include" }
+ libdirs { "/opt/homebrew/opt/openal-soft/lib" }
+
+ filter "platforms:macosx-amd64-*oal"
includedirs { "/usr/local/opt/openal-soft/include" }
libdirs { "/usr/local/opt/openal-soft/lib" }
@@ -417,10 +444,18 @@ project "re3"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
- filter "platforms:macosx*gl3_glfw*"
+ filter "platforms:macosx-arm64-*gl3_glfw*"
links { "glfw" }
linkoptions { "-framework OpenGL" }
includedirs { "/opt/local/include" }
- includedirs { "/usr/local/include" }
+ includedirs {"/opt/homebrew/include" }
+ libdirs { "/opt/local/lib" }
+ libdirs { "/opt/homebrew/lib" }
+
+ filter "platforms:macosx-amd64-*gl3_glfw*"
+ links { "glfw" }
+ linkoptions { "-framework OpenGL" }
+ includedirs { "/opt/local/include" }
+ includedirs {"/usr/local/include" }
libdirs { "/opt/local/lib" }
libdirs { "/usr/local/lib" }