From 0dfd165b5381286dc76f96637b9eb24b26a0b4b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Dec 2015 18:21:26 +0200 Subject: Use 'extension' variable for cxx target types, .*xx extensions by default One can also do: define cpp: cxx cpp{*}: extension = cpp cpp{foo}: # foo.cpp --- build/cxx/target.cxx | 26 ++++++++++++++------------ build/root.build | 8 ++++---- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'build') diff --git a/build/cxx/target.cxx b/build/cxx/target.cxx index b84167b..314f758 100644 --- a/build/cxx/target.cxx +++ b/build/cxx/target.cxx @@ -10,68 +10,70 @@ namespace build { namespace cxx { - constexpr const char hxx_ext_var[] = "hxx.ext"; + constexpr const char ext_var[] = "extension"; + + constexpr const char hxx_ext_def[] = "hxx"; const target_type hxx::static_type { "hxx", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; - constexpr const char ixx_ext_var[] = "ixx.ext"; + constexpr const char ixx_ext_def[] = "ixx"; const target_type ixx::static_type { "ixx", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; - constexpr const char txx_ext_var[] = "txx.ext"; + constexpr const char txx_ext_def[] = "txx"; const target_type txx::static_type { "txx", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; - constexpr const char cxx_ext_var[] = "cxx.ext"; + constexpr const char cxx_ext_def[] = "cxx"; const target_type cxx::static_type { "cxx", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; - constexpr const char h_ext_var[] = "h.ext"; + constexpr const char h_ext_def[] = "h"; const target_type h::static_type { "h", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; - constexpr const char c_ext_var[] = "c.ext"; + constexpr const char c_ext_def[] = "c"; const target_type c::static_type { "c", &file::static_type, &target_factory, - &target_extension_var, + &target_extension_var, &search_file, false }; diff --git a/build/root.build b/build/root.build index 1be6cb7..230c58d 100644 --- a/build/root.build +++ b/build/root.build @@ -4,10 +4,10 @@ using cxx -hxx.ext = -ixx.ext = ixx -txx.ext = txx -cxx.ext = cxx +hxx{*}: extension = +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx cxx.std = 14 cxx.poptions += -I$src_root -- cgit v1.1