aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/target.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-24 17:41:30 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-28 15:01:48 +0300
commit4bdf53837e010073de802070d4e6087410662d3e (patch)
tree2820d3964877d1a7d498833da325aa3d3a699353 /libbuild2/cc/target.cxx
parentea24f530048cbce0c5335ca3fd3632c8ce34315a (diff)
Move cc build system module to separate library
Diffstat (limited to 'libbuild2/cc/target.cxx')
-rw-r--r--libbuild2/cc/target.cxx101
1 files changed, 101 insertions, 0 deletions
diff --git a/libbuild2/cc/target.cxx b/libbuild2/cc/target.cxx
new file mode 100644
index 0000000..a438898
--- /dev/null
+++ b/libbuild2/cc/target.cxx
@@ -0,0 +1,101 @@
+// file : libbuild2/cc/target.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <libbuild2/cc/target.hxx>
+
+#include <libbuild2/context.hxx>
+
+using namespace std;
+
+namespace build2
+{
+ namespace cc
+ {
+ const target_type cc::static_type
+ {
+ "cc",
+ &file::static_type,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &target_search,
+ false
+ };
+
+ extern const char h_ext_def[] = "h";
+
+ const target_type h::static_type
+ {
+ "h",
+ &cc::static_type,
+ &target_factory<h>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<h_ext_def>,
+ &target_pattern_var<h_ext_def>,
+ nullptr,
+ &file_search,
+ false
+ };
+
+ extern const char c_ext_def[] = "c";
+
+ const target_type c::static_type
+ {
+ "c",
+ &cc::static_type,
+ &target_factory<c>,
+ nullptr, /* fixed_extension */
+ &target_extension_var<c_ext_def>,
+ &target_pattern_var<c_ext_def>,
+ nullptr,
+ &file_search,
+ false
+ };
+
+ const target_type pc::static_type
+ {
+ "pc",
+ &file::static_type,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ &target_search,
+ false
+ };
+
+ extern const char pca_ext[] = "static.pc"; // VC14 rejects constexpr.
+
+ const target_type pca::static_type
+ {
+ "pca",
+ &pc::static_type,
+ &target_factory<pca>,
+ &target_extension_fix<pca_ext>,
+ nullptr, /* default_extension */
+ &target_pattern_fix<pca_ext>,
+ &target_print_0_ext_verb, // Fixed extension, no use printing.
+ &file_search,
+ false
+ };
+
+ extern const char pcs_ext[] = "shared.pc"; // VC14 rejects constexpr.
+
+ const target_type pcs::static_type
+ {
+ "pcs",
+ &pc::static_type,
+ &target_factory<pcs>,
+ &target_extension_fix<pcs_ext>,
+ nullptr, /* default_extension */
+ &target_pattern_fix<pcs_ext>,
+ &target_print_0_ext_verb, // Fixed extension, no use printing.
+ &file_search,
+ false
+ };
+ }
+}