From 01ea7801fdd51852a4312350cd6c8bf91efe8666 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Tue, 29 Sep 2020 20:39:18 -0400 Subject: macOS support; thanks to @MrYadro This should support ARM64 and x86-64. -target flag based on information from https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary#3618377. --- premake5.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index 881035ef..36388a1e 100644 --- a/premake5.lua +++ b/premake5.lua @@ -85,6 +85,12 @@ workspace "re3" "bsd-amd64-librw_gl3_glfw-oal" } + filter { "system:macosx" } + platforms { + "macosx-amd64-librw_gl3_glfw-oal", + "macosx-arm64-librw_gl3_glfw-oal", + } + filter "configurations:Debug" defines { "DEBUG" } @@ -100,6 +106,9 @@ workspace "re3" filter { "platforms:bsd*" } system "bsd" + + filter { "platforms:macosx*" } + system "macosx" filter { "platforms:*x86*" } architecture "x86" @@ -110,6 +119,12 @@ workspace "re3" filter { "platforms:*arm*" } architecture "ARM" + filter { "platforms:macosx-arm64-*" } + buildoptions { "-target", "arm64-apple-macos11", "-std=gnu++14" } + + filter { "platforms:macosx-amd64-*" } + buildoptions { "-target", "x86_64-apple-macos10.12", "-std=gnu++14" } + filter { "platforms:*librw_d3d9*" } defines { "RW_D3D9" } if(not _OPTIONS["with-librw"]) then @@ -162,6 +177,13 @@ project "librw" filter "platforms:bsd*" includedirs { "/usr/local/include" } libdirs { "/usr/local/lib" } + + filter "platforms:macosx*" + -- Support MacPorts and Homebrew + includedirs { "/opt/local/include" } + includedirs {"/usr/local/include" } + libdirs { "/opt/local/lib" } + libdirs { "/usr/local/lib" } filter "platforms:*RW33*" flags { "ExcludeFromBuild" } @@ -276,6 +298,11 @@ project "re3" filter "platforms:bsd*oal" links { "openal", "mpg123", "sndfile", "pthread" } + + filter "platforms:macosx*oal" + links { "openal", "mpg123", "sndfile", "pthread" } + includedirs { "/usr/local/opt/openal-soft/include" } + libdirs { "/usr/local/opt/openal-soft/lib" } if _OPTIONS["with-opus"] then filter {} @@ -329,3 +356,11 @@ project "re3" links { "GL", "GLEW", "glfw", "sysinfo" } includedirs { "/usr/local/include" } libdirs { "/usr/local/lib" } + + filter "platforms:macosx*gl3_glfw*" + links { "GLEW", "glfw" } + linkoptions { "-framework OpenGL" } + includedirs { "/opt/local/include" } + includedirs { "/usr/local/include" } + libdirs { "/opt/local/lib" } + libdirs { "/usr/local/lib" } -- cgit v1.2.3 From 34579ae9c39e2c0a8c4d136cf0d0dd4c7dac1ade Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Thu, 1 Oct 2020 20:44:33 -0400 Subject: premake5: Place macosx-amd64 after arm64 Fixes xcode4 project from Premake getting the wrong target (for now). --- premake5.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index 36388a1e..49be07c3 100644 --- a/premake5.lua +++ b/premake5.lua @@ -87,8 +87,8 @@ workspace "re3" filter { "system:macosx" } platforms { - "macosx-amd64-librw_gl3_glfw-oal", "macosx-arm64-librw_gl3_glfw-oal", + "macosx-amd64-librw_gl3_glfw-oal", } filter "configurations:Debug" -- cgit v1.2.3