aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-04-18 09:23:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-04-18 09:23:24 +0200
commit8aeae026d112ff9811a424e31621c05682f4a72e (patch)
tree9dc5c736fb07fb6cafe3a08a7e999b9c084edc18 /libbuild2/cc/link-rule.cxx
parenta1a01cbce316c5da7aa94e6b6a71eae98bffed1c (diff)
Add support for Assembler with C Preprocessor (.S) compilation
Specifically, the c module now provides the c.as-cpp submodules which can be loaded in order to register the S{} target type and enable Assembler with C Preprocessor compilation in the c compile rule. For details, refer to "Assembler with C Preprocessor Compilation" in the manual.
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 76fd3c5..e2bdf5d 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -292,6 +292,7 @@ namespace build2
if (p.is_a (x_src) ||
(x_mod != nullptr && p.is_a (*x_mod)) ||
+ (x_asp != nullptr && p.is_a (*x_asp)) ||
(x_obj != nullptr && p.is_a (*x_obj)) ||
// Header-only X library (or library with C source and X header).
(library && x_header (p, false /* c_hdr */)))
@@ -1003,6 +1004,7 @@ namespace build2
if (!um)
um = (p.is_a (x_src) || p.is_a<c> () ||
(x_mod != nullptr && p.is_a (*x_mod)) ||
+ (x_asp != nullptr && p.is_a (*x_asp)) ||
(x_obj != nullptr && (p.is_a (*x_obj) || p.is_a<m> ())) ||
x_header (p, true));
#endif
@@ -1032,8 +1034,9 @@ namespace build2
bool mod (x_mod != nullptr && p.is_a (*x_mod));
bool hdr (false);
- if (mod ||
- p.is_a (x_src) || p.is_a<c> () ||
+ if (mod ||
+ p.is_a (x_src) || p.is_a<c> () ||
+ (x_asp != nullptr && p.is_a (*x_asp)) ||
(x_obj != nullptr && (p.is_a (*x_obj) || p.is_a<m> ())))
{
binless = binless && (mod ? user_binless : false);
@@ -1902,7 +1905,8 @@ namespace build2
//
if (mod
? p1.is_a (*x_mod)
- : (p1.is_a (x_src) || p1.is_a<c> () ||
+ : (p1.is_a (x_src) || p1.is_a<c> () ||
+ (x_asp != nullptr && p1.is_a (*x_asp)) ||
(x_obj != nullptr && (p1.is_a (*x_obj) || p1.is_a<m> ()))))
{
src = true;
@@ -1916,8 +1920,9 @@ namespace build2
p1.is_a<libx> () ||
p1.is_a<liba> () || p1.is_a<libs> () || p1.is_a<libux> () ||
p1.is_a<bmi> () || p1.is_a<bmix> () ||
- ((mod ||
- p.is_a (x_src) ||
+ ((mod ||
+ p.is_a (x_src) ||
+ (x_asp != nullptr && p.is_a (*x_asp)) ||
(x_obj != nullptr && p.is_a (*x_obj))) && x_header (p1)) ||
((p.is_a<c> () ||
(x_obj != nullptr && p.is_a<m> ())) && p1.is_a<h> ()))
@@ -2062,7 +2067,8 @@ namespace build2
{
if (mod
? p1.is_a (*x_mod)
- : (p1.is_a (x_src) || p1.is_a<c> () ||
+ : (p1.is_a (x_src) || p1.is_a<c> () ||
+ (x_asp != nullptr && p1.is_a (*x_asp)) ||
(x_obj != nullptr && (p1.is_a (*x_obj) || p1.is_a<m> ()))))
{
// Searching our own prerequisite is ok, p1 must already be