diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2010-05-29 07:25:38 +0000 |
| commit | 72c06a258940696093f255fb1061beb58e1cdd0b (patch) | |
| tree | 36b9a7712eec2d4f07837eab9c38ef1c5af85319 /other/sdl/sdl.lua | |
| parent | e56feb597bc743677633432f77513b02907fd169 (diff) | |
| download | zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.tar.gz zcatch-72c06a258940696093f255fb1061beb58e1cdd0b.zip | |
copied refactor to trunk
Diffstat (limited to 'other/sdl/sdl.lua')
| -rw-r--r-- | other/sdl/sdl.lua | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/other/sdl/sdl.lua b/other/sdl/sdl.lua index be94209d..23b287c7 100644 --- a/other/sdl/sdl.lua +++ b/other/sdl/sdl.lua @@ -1,43 +1,43 @@ SDL = { - basepath = PathPath(ModuleFilename()), + basepath = PathDir(ModuleFilename()), OptFind = function (name, required) local check = function(option, settings) - option.value = nil - option.use_sdlconfig = nil - option.use_win32sdl = nil - option.use_osxframework = nil + option.value = false + option.use_sdlconfig = false + option.use_win32sdl = false + option.use_osxframework = false option.lib_path = nil if ExecuteSilent("sdl-config") > 0 and ExecuteSilent("sdl-config --cflags") == 0 then - option.value = 1 - option.use_sdlconfig = 1 + option.value = true + option.use_sdlconfig = true end if platform == "win32" then - option.value = 1 - option.use_win32sdl = 1 + option.value = true + option.use_win32sdl = true end if platform == "macosx" then - option.value = 1 - option.use_osxframework = 1 - option.use_sdlconfig = nil + option.value = true + option.use_osxframework = true + option.use_sdlconfig = false end end local apply = function(option, settings) - if option.use_sdlconfig then + if option.use_sdlconfig == true then settings.cc.flags:Add("`sdl-config --cflags`") settings.link.flags:Add("`sdl-config --libs`") end - if option.use_osxframework then + if option.use_osxframework == true then client_settings.link.frameworks:Add("SDL") client_settings.cc.includes:Add("/Library/Frameworks/SDL.framework/Headers") end - if option.use_win32sdl then + if option.use_win32sdl == true then settings.cc.includes:Add(SDL.basepath .. "/include") settings.link.libpath:Add(SDL.basepath .. "/vc2005libs") settings.link.libs:Add("SDL") @@ -53,10 +53,10 @@ SDL = { end local display = function(option) - if option.value then - if option.use_sdlconfig then return "using sdl-config" end - if option.use_win32sdl then return "using supplied win32 libraries" end - if option.use_osxframework then return "using osx framework" end + if option.value == true then + if option.use_sdlconfig == true then return "using sdl-config" end + if option.use_win32sdl == true then return "using supplied win32 libraries" end + if option.use_osxframework == true then return "using osx framework" end return "using unknown method" else if option.required then |