forked from TurkeyMan/premake-emscripten
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathemscripten_gmake.lua
34 lines (27 loc) · 866 Bytes
/
emscripten_gmake.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local p = premake
require("gmake")
require("gmake2")
--
-- Patch the gmake action with the allowed tools...
--
local gmake = p.action.get( 'gmake' )
if gmake == nil then
error( "Failed to locate prequisite action 'gmake'" )
end
table.insert( gmake.valid_tools.cc, p.EMCC )
--
-- Patch the gmake action with the allowed tools...
--
local gmake2 = p.action.get( 'gmake2' )
if gmake == nil then
error( "Failed to locate prequisite action 'gmake2'" )
end
table.insert( gmake2.valid_tools.cc, p.EMCC )
if premake.modules.vstool ~= nil then
premake.override(premake.modules.vstool, "isclang", function(oldfn, cfg)
return cfg.toolset == "emcc" or oldfn(cfg)
end)
premake.override(premake.modules.vstool, "isvstool", function(oldfn, cfg)
return not (cfg.system == "emscripten" or cfg.toolset == "emcc") and oldfn(cfg)
end)
end