use system installed sdl on osx

This commit is contained in:
Joel de Vahl 2008-10-21 16:16:16 +00:00
parent 8edfa80028
commit 21445b67bb
2 changed files with 12 additions and 4 deletions

View file

@ -29,6 +29,9 @@ function OptFindSDL(name, required)
option.use_sdlconfig = 1
end
if platform == "macosx" then
option.value = 1
end
end
local apply = function(option, settings)
@ -36,7 +39,12 @@ function OptFindSDL(name, required)
settings.cc.flags = settings.cc.flags .. " -I/usr/include/SDL "
settings.linker.flags = settings.linker.flags .. " `sdl-config --libs` "
else
-- do something else here
if platform == "macosx" then
client_settings.linker.frameworks:add("SDL")
client_settings.cc.includes:add("/Library/Frameworks/SDL.framework/Headers")
else
-- do something else
end
end
end
@ -355,8 +363,7 @@ function build(settings)
if use_sdl then
client_settings.linker.frameworks:add("SDL")
client_settings.cc.includes:add("SDL.framework/Headers")
client_settings.linker.frameworkpath:add(".")
client_settings.cc.includes:add("/Library/Frameworks/SDL.framework/Headers")
end
else
if config.alsa.value == 1 then

View file

@ -92,7 +92,8 @@ if use_bundle:
shutil.copy("other/icons/Teeworlds.icns", bundle_resource_dir)
shutil.copy(name+exe_ext, bundle_bin_dir)
shutil.copy(name+"_srv"+exe_ext, bundle_bin_dir)
#copydir("SDL.framework", bundle_framework_dir)
print(bundle_framework_dir)
os.system("cp -R /Library/Frameworks/SDL.framework " + bundle_framework_dir)
file(os.path.join(bundle_content_dir, "Info.plist"), "w").write("""
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">