From 07e66cd3d6d235496f6817e1b06e409ea55ea377 Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Tue, 3 Feb 2026 15:45:06 -0500 Subject: [PATCH] Fixed premake SDL2 framework linking on macOS --- RecastDemo/premake5.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/RecastDemo/premake5.lua b/RecastDemo/premake5.lua index 570f135f..cd5808a2 100644 --- a/RecastDemo/premake5.lua +++ b/RecastDemo/premake5.lua @@ -159,11 +159,14 @@ project "Contrib" filter "system:macosx" includedirs { "Bin/SDL2.framework/Headers" } externalincludedirs { "Bin/SDL2.framework/Headers" } + frameworkdirs { "Bin" } project "RecastDemo" language "C++" cppdialect "C++20" -- we don't care about this being compatible in the same way we do with the library code. kind "WindowedApp" + targetdir "Bin" + includedirs { "../RecastDemo/Include", "../DebugUtils/Include", @@ -193,10 +196,7 @@ project "RecastDemo" "Contrib" } - -- distribute executable in RecastDemo/Bin directory - targetdir "Bin" - -- linux library cflags and libs filter "system:linux" buildoptions { "`pkg-config --cflags sdl2`", @@ -210,12 +210,6 @@ project "RecastDemo" "`pkg-config --libs glu`" } - filter { "system:linux", "toolset:gcc", "files:*.c" } - buildoptions { - "-Wno-class-memaccess" - } - - -- windows library cflags and libs filter "system:windows" includedirs { "../RecastDemo/Contrib/SDL/include" } libdirs { "../RecastDemo/Contrib/SDL/lib/%{cfg.architecture:gsub('x86_64', 'x64')}" } @@ -233,9 +227,10 @@ project "RecastDemo" -- mac includes and libs filter "system:macosx" - kind "ConsoleApp" -- xcode4 failes to run the project if using WindowedApp + kind "ConsoleApp" includedirs { "Bin/SDL2.framework/Headers" } externalincludedirs { "Bin/SDL2.framework/Headers" } + frameworkdirs { "Bin" } links { "OpenGL.framework", "SDL2.framework",