From 3e39190bc50284a620605c7b61faff197e116457 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jan 2016 12:13:06 +0200 Subject: Clean up default target extension derivation logic --- build2/bin/target.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'build2/bin') 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, - nullptr, + &target_extension_fix, &search_file, false }; -- cgit v1.1