diff options
Diffstat (limited to '3rdparty/genie/src/actions/make/make_cpp.lua')
-rw-r--r-- | 3rdparty/genie/src/actions/make/make_cpp.lua | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/3rdparty/genie/src/actions/make/make_cpp.lua b/3rdparty/genie/src/actions/make/make_cpp.lua index a0e5bd2bae1..e36bb41c05b 100644 --- a/3rdparty/genie/src/actions/make/make_cpp.lua +++ b/3rdparty/genie/src/actions/make/make_cpp.lua @@ -21,21 +21,10 @@ for _, platform in ipairs(platforms) do for cfg in premake.eachconfig(prj, platform) do - premake.gmake_cpp_config(cfg, cc) + premake.gmake_cpp_config(prj, cfg, cc) end end - -- list intermediate files - _p('OBJECTS := \\') - for _, file in ipairs(prj.files) do - if path.iscppfile(file) then - _p('\t$(OBJDIR)/%s.o \\' - , _MAKE.esc(path.trimdots(path.removeext(file))) - ) - end - end - _p('') - -- list object directories local objdirs = {} for _, file in ipairs(prj.files) do @@ -228,7 +217,7 @@ -- Write a block of configuration settings. -- - function premake.gmake_cpp_config(cfg, cc) + function premake.gmake_cpp_config(prj, cfg, cc) _p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname)) @@ -250,6 +239,27 @@ -- write out libraries, linker flags, and the link command cpp.linker(cfg, cc) + -- add objects for compilation, and remove any that are excluded per config. + _p(' OBJECTS := \\') + for _, file in ipairs(prj.files) do + if path.iscppfile(file) then + -- check if file is excluded. + local excluded = false + for _, exclude in ipairs(cfg.excludes) do + excluded = (exclude == file) + if (excluded) then break end + end + + -- if not excluded, add it. + if excluded == false then + _p('\t$(OBJDIR)/%s.o \\' + , _MAKE.esc(path.trimdots(path.removeext(file))) + ) + end + end + end + _p('') + _p(' define PREBUILDCMDS') if #cfg.prebuildcommands > 0 then _p('\t@echo Running pre-build commands') |