From 1902b9221014ac194770af9119a68516a474305d Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 10 Sep 2022 15:20:08 +0200 Subject: [PATCH] bam.lua: Add "intermediate" directory to paths and use it when building object files. --- bam.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bam.lua b/bam.lua index d4b62ae..8838de9 100644 --- a/bam.lua +++ b/bam.lua @@ -24,9 +24,15 @@ end -- paths used when building. paths = { - build = ScriptArgs.build_dir or "build", - object = "obj", - examples = "examples" + -- Root build directory. + build = ScriptArgs.build_dir or "build", + + -- Directory where internal object/libs files are + -- stored to produce the final library. + intermediate = PathJoin("spectre", TARGET_OS), + + object = "obj", + examples = "examples" } -------------------------------- @@ -59,7 +65,8 @@ global_settings.link.Output = function(settings, input) end global_settings.cc.Output = function(settings, input) - return Path(PathJoin(PathJoin(paths.build, paths.object), PathBase(input))) + local path = PathJoin(paths.build, paths.intermediate) + return Path(PathJoin(PathJoin(path, paths.object), PathBase(input))) end -- Compiler configuration