From: Mikko Rasa Date: Sat, 28 Aug 2021 11:46:01 +0000 (+0300) Subject: Make object file names configurable through Architecture X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=76ede1d44e68182a2380260c22ec7be68c9817af;p=builder.git Make object file names configurable through Architecture --- diff --git a/source/architecture.cpp b/source/architecture.cpp index 9ce1ace..63ec6ba 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -147,6 +147,7 @@ Architecture::Architecture(Builder &b, const string &spec): name += format("-%s", fpu); name += format("-%d-%s-%s", bits, system, toolchain); + object_patterns.push_back(Pattern("%.o")); if(system=="windows") { sharedlib_patterns.push_back(Pattern("%.dll")); diff --git a/source/architecture.h b/source/architecture.h index c1446b4..6828ad8 100644 --- a/source/architecture.h +++ b/source/architecture.h @@ -33,6 +33,7 @@ private: std::string name; bool native; std::string cross_prefix; + PatternList object_patterns; PatternList sharedlib_patterns; PatternList staticlib_patterns; PatternList executable_patterns; @@ -54,6 +55,7 @@ public: const std::string &get_cross_prefix() const { return cross_prefix; } + const PatternList &get_object_patterns() const { return object_patterns; } const PatternList &get_shared_library_patterns() const { return sharedlib_patterns; } const PatternList &get_static_library_patterns() const { return staticlib_patterns; } const PatternList &get_executable_patterns() const { return executable_patterns; } diff --git a/source/objectfile.cpp b/source/objectfile.cpp index f413ad4..ab10c61 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -35,7 +35,8 @@ FS::Path ObjectFile::generate_target_path(const Component &comp, const FS::Path if(*i!=".") fn += *i; } - return temp_dir/(FS::basepart(fn)+".o"); + const Architecture &arch = comp.get_package().get_builder().get_current_arch(); + return temp_dir/arch.get_object_patterns().front().apply(FS::basepart(fn)); } void ObjectFile::set_used_in_shared_library(bool u)