diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-09 11:31:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-12 17:04:22 +0200 |
commit | 9fa5f73d00905568e8979d0c93ec4a8f645c81d5 (patch) | |
tree | f2bf937fa256c0ef2c9bbe05d3655d1985719405 /build2/cxx/install.cxx | |
parent | a1b2319ff2ddc8a6f139ee364cabe236ca62e23e (diff) |
Implement support for C compilation
We now have two new modules: cc (c-common) and c.
Diffstat (limited to 'build2/cxx/install.cxx')
-rw-r--r-- | build2/cxx/install.cxx | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/build2/cxx/install.cxx b/build2/cxx/install.cxx deleted file mode 100644 index e07d115..0000000 --- a/build2/cxx/install.cxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : build2/cxx/install.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include <build2/cxx/install> - -#include <build2/bin/target> - -#include <build2/cxx/link> -#include <build2/cxx/common> -#include <build2/cxx/target> - -using namespace std; - -namespace build2 -{ - namespace cxx - { - using namespace bin; - - target* install:: - filter (action a, target& t, prerequisite_member p) const - { - if (t.is_a<exe> ()) - { - // Don't install executable's prerequisite headers. - // - if (p.is_a<hxx> () || p.is_a<ixx> () || p.is_a<txx> () || p.is_a<h> ()) - return nullptr; - } - - // If this is a shared library prerequisite, install it as long as it - // is in the same amalgamation as we are. - // - // @@ Shouldn't we also install a static library prerequisite of a - // static library? - // - if ((t.is_a<exe> () || t.is_a<libs> ()) && - (p.is_a<lib> () || p.is_a<libs> ())) - { - target* pt (&p.search ()); - - // If this is the lib{} group, pick a member which we would link. - // - if (lib* l = pt->is_a<lib> ()) - pt = &link_member (*l, link_order (t.base_scope (), link_type (t))); - - if (pt->is_a<libs> ()) // Can be liba{}. - return pt->in (t.weak_scope ()) ? pt : nullptr; - } - - return file_rule::filter (a, t, p); - } - - match_result install:: - match (action a, target& t, const string& hint) const - { - // @@ How do we split the hint between the two? - // - - // We only want to handle installation if we are also the - // ones building this target. So first run link's match(). - // - match_result r (link::instance.match (a, t, hint)); - return r ? install::file_rule::match (a, t, "") : r; - } - - install install::instance; - } -} |