Index: build/premake/extern_libs5.lua =================================================================== --- build/premake/extern_libs5.lua +++ build/premake/extern_libs5.lua @@ -37,6 +37,18 @@ sysincludedirs { third_party_source_dir .. extern_lib .. "/include" } end +local function get_wx_config_path() + local wx_config_path = os.getenv("WX_CONFIG") + if not wx_config_path then + local haswxconfig = os.outputof("which wx-config") + if not haswxconfig then + error("WX_CONFIG must be set or wx-config must be present when --atlas is passed.") + end + wx_config_path="wx-config" + end + return wx_config_path +end + pkgconfig = require "pkgconfig" -- Configure pkgconfig for MacOSX systems @@ -690,16 +702,14 @@ else -- wxwidgets does not come with a definition file for pkg-config, -- so we have to use wxwidgets' own config tool - wx_config_path = os.getenv("WX_CONFIG") or "wx-config" - pkgconfig.add_includes(nil, wx_config_path, "--unicode=yes --cxxflags") + pkgconfig.add_includes(nil, get_wx_config_path(), "--unicode=yes --cxxflags") end end, link_settings = function() if os.istarget("windows") then libdirs { libraries_dir.."wxwidgets/lib/vc_lib" } else - wx_config_path = os.getenv("WX_CONFIG") or "wx-config" - pkgconfig.add_links(nil, wx_config_path, "--unicode=yes --libs std,gl") + pkgconfig.add_links(nil, get_wx_config_path(), "--unicode=yes --libs std,gl") end end, },