External tools now have a build signature by default.
string DataTool::create_build_signature(const BuildInfo &binfo) const
{
- string result;
+ string result = Tool::create_build_signature(binfo);
+ if(binfo.debug || binfo.optimize)
+ result += ',';
if(binfo.debug)
result += 'g';
if(binfo.optimize>0)
return lib;
}
-string GnuArchiver::create_build_signature(const BuildInfo &) const
-{
- return FS::basename(executable->get_path());
-}
-
Task *GnuArchiver::run(const Target &target) const
{
const StaticLibrary &lib = dynamic_cast<const StaticLibrary &>(target);
GnuArchiver(Builder &, const Architecture &);
Target *create_target(const std::list<Target *> &, const std::string &) override;
- std::string create_build_signature(const BuildInfo &) const override;
Task *run(const Target &) const override;
};
if(!executable)
return string();
- string result = FS::basename(executable->get_path());
+ string result = Tool::create_build_signature(binfo);
if(!architecture->get_cpu().empty())
{
result += ",m";
result += architecture->get_cpu();
}
- result += ',';
+ if(binfo.debug || binfo.optimize)
+ result += ',';
if(binfo.debug)
result += 'g';
if(binfo.optimize)
string GnuLinker::Linker::create_build_signature(const BuildInfo &binfo) const
{
- string result = FS::basename(executable->get_path());
+ string result = Tool::create_build_signature(binfo);
result += ',';
if(binfo.libmode<=BuildInfo::STATIC)
result += 't';
return lib;
}
-string MsvcArchiver::create_build_signature(const BuildInfo &) const
-{
- return FS::basename(executable->get_path());
-}
-
Task *MsvcArchiver::run(const Target &target) const
{
const StaticLibrary &lib = dynamic_cast<const StaticLibrary &>(target);
MsvcArchiver(Builder &, const Architecture &, const MicrosoftTools &);
Target *create_target(const std::list<Target *> &, const std::string &) override;
- std::string create_build_signature(const BuildInfo &) const override;
Task *run(const Target &) const override;
};
string MsvcCompiler::create_build_signature(const BuildInfo &binfo) const
{
- string result = FS::basename(executable->get_path());
+ string result = Tool::create_build_signature(binfo);
result += ',';
if(binfo.debug)
result += 'g';
string MsvcLinker::create_build_signature(const BuildInfo &binfo) const
{
- string result = FS::basename(executable->get_path());
+ string result = Tool::create_build_signature(binfo);
result += ',';
if(binfo.strip)
result += 's';
#include <msp/core/algorithm.h>
+#include <msp/fs/utils.h>
#include <msp/strings/format.h>
#include "architecture.h"
#include "builder.h"
+#include "filetarget.h"
#include "tool.h"
using namespace std;
}
}
+string Tool::create_build_signature(const BuildInfo &) const
+{
+ if(executable)
+ return format("%s=%s", tag, FS::basename(executable->get_path()));
+ else
+ return string();
+}
+
SubTool::SubTool(Tool &p):
Tool(p),
null if the tool does not want to handle installing in a special way. */
virtual Target *create_install(Target &) const { return 0; }
- virtual std::string create_build_signature(const BuildInfo &) const { return std::string(); }
+ virtual std::string create_build_signature(const BuildInfo &) const;
void prepare();