aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-01-23 12:13:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-01-23 12:13:06 +0200
commit3e39190bc50284a620605c7b61faff197e116457 (patch)
treef121a5df5b275816205d8ab9d9a1036683e02d15 /build2/bin
parentdb0edaafe15831ba6fa9c2109da37942506c62b1 (diff)
Clean up default target extension derivation logic
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/target.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx
index 9d96ca4..136de9c 100644
--- a/build2/bin/target.cxx
+++ b/build2/bin/target.cxx
@@ -27,7 +27,7 @@ namespace build2
"obja",
&file::static_type,
&obja_factory,
- nullptr,
+ &target_extension_assert,
&search_target, // Note: not _file(); don't look for an existing file.
false
};
@@ -49,7 +49,7 @@ namespace build2
"objso",
&file::static_type,
&objso_factory,
- nullptr,
+ &target_extension_assert,
&search_target, // Note: not _file(); don't look for an existing file.
false
};
@@ -80,12 +80,24 @@ namespace build2
false
};
+ // @@ What extension should we be using when searching for an existing
+ // exe{}? Say we have a dependency on some pre-existing tool, maybe
+ // some source code generator. Should we use 'build' extension? But
+ // what if we find such an executable for something that we need to
+ // build for 'host'?
+ //
+ // What if we use extension variables and scoping. We could set the
+ // root scope exe{*} extension to 'build' and then, say, cxx module
+ // (or any module that knows how to build exe{}) changes it to the
+ // 'host'. Maybe that's not a bad idea?
+ //
+ constexpr const char exe_ext[] = "";
const target_type exe::static_type
{
"exe",
&file::static_type,
&target_factory<exe>,
- nullptr,
+ &target_extension_fix<exe_ext>,
&search_file,
false
};