using namespace Msp;
AndroidCompiler::AndroidCompiler(Builder &b, const Architecture &a, const string &t, const AndroidNdk &n):
- GnuCompiler(b, a, t, n.get_platform_sysroot()),
+ GnuCompiler(b, a, t),
ndk(n)
{
if(ndk.get_root_dir().empty())
if(ndk.get_platform_sysroot().empty())
problems.push_back("Android platform not found");
+ else
+ build_info.sysroot = ndk.get_platform_sysroot();
- build_info.incpath.insert(build_info.incpath.end(), system_path.begin(), system_path.end());
if(tag=="CXX")
build_info.libs.push_back("gnustl_static");
}
using namespace std;
AndroidLinker::AndroidLinker(Builder &b, const Architecture &a, const AndroidNdk &ndk):
- GnuLinker(b, a, ndk.get_platform_sysroot())
+ GnuLinker(b, a)
{
- set_command((ndk.get_bin_dir()/command).str());
- build_info.libpath.insert(build_info.libpath.end(), system_path.begin(), system_path.end());
+ build_info.sysroot = ndk.get_platform_sysroot();
}
Target *AndroidLinker::create_target(const list<Target *> &sources, const string &)
using namespace std;
using namespace Msp;
-ClangCompiler::ClangCompiler(Builder &b, const Architecture &a, const string &t, const FS::Path &r):
- GnuCompiler(b, a, t, r)
+ClangCompiler::ClangCompiler(Builder &b, const Architecture &a, const string &t):
+ GnuCompiler(b, a, t)
{
set_command((tag=="CXX" ? "clang++" : "clang"), true);
}
class ClangCompiler: public GnuCompiler
{
public:
- ClangCompiler(Builder &, const Architecture &, const std::string &, const Msp::FS::Path & = Msp::FS::Path());
+ ClangCompiler(Builder &, const Architecture &, const std::string &);
};
#endif
}
-GnuCompiler::GnuCompiler(Builder &b, const Architecture &a, const string &t, const FS::Path &sysroot):
+GnuCompiler::GnuCompiler(Builder &b, const Architecture &a, const string &t):
Tool(b, a, t)
{
if(tag=="CC")
throw invalid_argument("GnuCompiler::GnuCompiler");
set_command((tag=="CXX" ? "g++" : "gcc"), true);
-
- if(!sysroot.empty())
- build_info.sysroot = sysroot;
}
Target *GnuCompiler::create_source(const Component &comp, const FS::Path &path) const
class GnuCompiler: public Tool
{
public:
- GnuCompiler(Builder &, const Architecture &, const std::string &, const Msp::FS::Path & = Msp::FS::Path());
+ GnuCompiler(Builder &, const Architecture &, const std::string &);
virtual Target *create_source(const Component &, const Msp::FS::Path &) const;
virtual Target *create_source(const Msp::FS::Path &) const;
using namespace std;
using namespace Msp;
-GnuLinker::GnuLinker(Builder &b, const Architecture &a, const FS::Path &sysroot):
+GnuLinker::GnuLinker(Builder &b, const Architecture &a):
Tool(b, a, "LINK")
{
input_suffixes.push_back(".o");
processing_unit = COMPONENT;
- if(!sysroot.empty())
- build_info.sysroot = sysroot;
-
default_linker = new Linker(*this, "CC");
cxx_linker = new Linker(*this, "CXX");
}
void GnuLinker::Linker::do_prepare()
{
+ parent.prepare();
+ build_info = parent.get_build_info();
+ system_path = parent.get_system_path();
+
Tool &compiler = builder.get_toolchain().get_tool(compiler_tag);
if(dynamic_cast<GnuCompiler *>(&compiler))
{
Linker *cxx_linker;
public:
- GnuLinker(Builder &, const Architecture &, const Msp::FS::Path & = Msp::FS::Path());
+ GnuLinker(Builder &, const Architecture &);
~GnuLinker();
virtual Target *create_target(const std::list<Target *> &, const std::string &);