| @@ -250,7 +250,7 @@ dds::compilation_set collect_compiles(const build_params& params, const library_ | |||
| const auto obj_path = object_file_path(sf.path, params); | |||
| comps.compilations.push_back(file_compilation{std::move(rules), | |||
| sf.path, | |||
| sf, | |||
| obj_path, | |||
| params.export_name, | |||
| params.enable_warnings}); | |||
| @@ -272,9 +272,10 @@ void dds::build(const build_params& params, const library_manifest& man) { | |||
| archive_spec arc; | |||
| for (const auto& comp : compiles.compilations) { | |||
| arc.input_files.push_back(comp.obj); | |||
| if (comp.source.kind == source_kind::source) { | |||
| arc.input_files.push_back(comp.obj); | |||
| } | |||
| } | |||
| // arc.input_files = compile_sources(sources, params, man); | |||
| arc.out_path = params.out_root | |||
| / (fmt::format("lib{}{}", params.export_name, params.toolchain.archive_suffix())); | |||
| @@ -16,10 +16,10 @@ void file_compilation::compile(const toolchain& tc) const { | |||
| spdlog::info("[{}] Compile file: {}", | |||
| owner_name, | |||
| fs::relative(file, rules.base_path()).string()); | |||
| fs::relative(source.path, rules.base_path()).string()); | |||
| auto start_time = std::chrono::steady_clock::now(); | |||
| compile_file_spec spec{file, obj}; | |||
| compile_file_spec spec{source.path, obj}; | |||
| spec.enable_warnings = enable_warnings; | |||
| extend(spec.include_dirs, rules.include_dirs()); | |||
| @@ -33,11 +33,11 @@ void file_compilation::compile(const toolchain& tc) const { | |||
| spdlog::info("[{}] Compile file: {} - {:n}ms", | |||
| owner_name, | |||
| fs::relative(file, rules.base_path()).string(), | |||
| fs::relative(source.path, rules.base_path()).string(), | |||
| dur_ms.count()); | |||
| if (!compile_res.okay()) { | |||
| spdlog::error("Compilation failed: {}", file.string()); | |||
| spdlog::error("Compilation failed: {}", source.path.string()); | |||
| spdlog::error("Subcommand FAILED: {}\n{}", quote_command(cmd), compile_res.output); | |||
| throw compile_failure("Compilation failed."); | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| #pragma once | |||
| #include <dds/source.hpp> | |||
| #include <dds/toolchain.hpp> | |||
| #include <dds/util.hpp> | |||
| @@ -37,7 +38,7 @@ public: | |||
| struct file_compilation { | |||
| compilation_rules rules; | |||
| fs::path file; | |||
| source_file source; | |||
| fs::path obj; | |||
| std::string owner_name; | |||
| bool enable_warnings = false; | |||