]> git.tdb.fi Git - builder.git/commitdiff
Make object file names configurable through Architecture
authorMikko Rasa <tdb@tdb.fi>
Sat, 28 Aug 2021 11:46:01 +0000 (14:46 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 28 Aug 2021 12:12:41 +0000 (15:12 +0300)
source/architecture.cpp
source/architecture.h
source/objectfile.cpp

index 9ce1acef6c59883f8684eb324f2d594bb17f675f..63ec6ba3f3dc5da4f60bd814a592547c0c1c1d15 100644 (file)
@@ -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"));
index c1446b462949c662eb5f0b117f315f38a42c83f3..6828ad88337d3cd2b7c17a5b565e922b8e25fd55 100644 (file)
@@ -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; }
index f413ad4be1660df7bec4f233451fd0efc8f17963..ab10c6113eb4ab367bd3636ba15691e276005b2c 100644 (file)
@@ -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)