Adding .bam/compilers.lua
This commit is contained in:
parent
c83337b6a6
commit
d678f3c7a0
1 changed files with 33 additions and 0 deletions
33
.bam/compilers.lua
Normal file
33
.bam/compilers.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue