diff options
-rw-r--r-- | bdep/new.cli | 5 | ||||
-rw-r--r-- | bdep/new.cxx | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/bdep/new.cli b/bdep/new.cli index 7bbfe8f..bcbc6c6 100644 --- a/bdep/new.cli +++ b/bdep/new.cli @@ -316,6 +316,10 @@ namespace bdep Don't add support for installing.| + \li|\n\ \ \ \cb{export-stub} + + Add support for importing this project's targets from other projects.| + \li|\n\ \ \ \c{\b{prefix=}\i{dir}} Optional source prefix relative to project/package root.| @@ -642,6 +646,7 @@ namespace bdep bool no-tests; bool unit-tests; bool no-install; + bool export-stub; dir_path prefix; dir_path subdir; bool no-subdir; diff --git a/bdep/new.cxx b/bdep/new.cxx index 229a21d..e461d42 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -2777,6 +2777,24 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) } } + // build/export.build + // + if (!src && t.exe_opt.export_stub ()) + { + string sd ( + (pfx_src / (sub_src && !bfile_in_pfx_src ? sub : empty_dir_path)). + posix_representation ()); + + open (bd / "export." + build_ext); + os << "$out_root/" << '\n' + << "{" << '\n' + << " include " << (!sd.empty () ? sd : "./") << '\n' + << "}" << '\n' + << '\n' + << "export $out_root/" << sd << "$import.target" << '\n'; + os.close (); + } + break; } case type::lib: |