33 lines
998 B
Lua
33 lines
998 B
Lua
|
|
Import("path.lua")
|
|
|
|
function CustomCompileC(settings, input)
|
|
local cc = settings.cc
|
|
local outname = cc.Output(settings, input) .. cc.extension
|
|
cc.DriverC(settings.labelprefix .. "c " .. ModuleRelative(input), outname, input, settings)
|
|
AddDependency(outname, input)
|
|
if not IsOutput(input) then
|
|
bam_add_dependency_cpp(input)
|
|
end
|
|
return outname
|
|
end
|
|
|
|
function CustomCompileCXX(settings, input)
|
|
local cc = settings.cc
|
|
local outname = cc.Output(settings, input) .. cc.extension
|
|
cc.DriverCXX(settings.labelprefix .. "c++ " .. ModuleRelative(input), outname, input, settings)
|
|
AddDependency(outname, input)
|
|
if not IsOutput(input) then
|
|
bam_add_dependency_cpp(input)
|
|
end
|
|
return outname
|
|
end
|
|
|
|
function SetCompilers(settings)
|
|
settings.compile.mappings["c"] = CustomCompileC
|
|
|
|
settings.compile.mappings["cpp"] = CustomCompileCXX
|
|
settings.compile.mappings["cxx"] = CustomCompileCXX
|
|
settings.compile.mappings["c++"] = CustomCompileCXX
|
|
settings.compile.mappings["cc"] = CustomCompileCXX
|
|
end
|