Pārlūkot izejas kodu

Reformat

default_compile_flags
vector-of-bool pirms 5 gadiem
vecāks
revīzija
31277e3034
10 mainītis faili ar 40 papildinājumiem un 40 dzēšanām
  1. +4
    -4
      src/dds/build.cpp
  2. +1
    -1
      src/dds/catalog/get.hpp
  3. +1
    -1
      src/dds/compdb.cpp
  4. +1
    -1
      src/dds/deps.cpp
  5. +1
    -1
      src/dds/proc.win.cpp
  6. +21
    -22
      src/dds/repo/repo.cpp
  7. +1
    -1
      src/dds/repo/repo.hpp
  8. +7
    -6
      src/dds/toolchain/from_dds.test.cpp
  9. +2
    -2
      src/dds/toolchain/toolchain.cpp
  10. +1
    -1
      src/dds/util/algo.hpp

+ 4
- 4
src/dds/build.cpp Parādīt failu

@@ -244,10 +244,10 @@ void add_sdist_to_build(build_plan& plan,
}
}

void add_deps_to_build(build_plan& plan,
usage_requirement_map& ureqs,
const build_params& params,
build_env_ref env) {
void add_deps_to_build(build_plan& plan,
usage_requirement_map& ureqs,
const build_params& params,
build_env_ref env) {
auto sd_idx = params.dep_sdists //
| ranges::views::transform([](const auto& sd) {
return std::pair(sd.manifest.pkg_id.name, std::cref(sd));

+ 1
- 1
src/dds/catalog/get.hpp Parādīt failu

@@ -14,4 +14,4 @@ struct temporary_sdist {

temporary_sdist get_package_sdist(const package_info&);

} // namespace dds
} // namespace dds

+ 1
- 1
src/dds/compdb.cpp Parādīt failu

@@ -13,7 +13,7 @@ void dds::generate_compdb(const build_plan& plan, build_env_ref env) {

for (const compile_file_plan& cf : iter_compilations(plan)) {
auto cmd_info = cf.generate_compile_command(env);
auto entry = nlohmann::json::object({
auto entry = nlohmann::json::object({
{"directory", env.output_root.string()},
{"arguments", cmd_info.command},
{"file", cf.source_path().string()},

+ 1
- 1
src/dds/deps.cpp Parādīt failu

@@ -9,8 +9,8 @@

#include <range/v3/range/conversion.hpp>
#include <range/v3/view/transform.hpp>
#include <spdlog/spdlog.h>
#include <spdlog/fmt/ostr.h>
#include <spdlog/spdlog.h>

#include <cctype>
#include <map>

+ 1
- 1
src/dds/proc.win.cpp Parādīt failu

@@ -1,8 +1,8 @@
#ifdef _WIN32
#include "./proc.hpp"

#include <wil/resource.h>
#include <spdlog/spdlog.h>
#include <wil/resource.h>

#include <windows.h>


+ 21
- 22
src/dds/repo/repo.cpp Parādīt failu

@@ -111,26 +111,25 @@ const sdist* repository::find(const package_id& pkg) const noexcept {
}

std::vector<package_id> repository::solve(const std::vector<dependency>& deps,
const catalog& ctlg) const {
return dds::solve(deps,
[&](std::string_view name) -> std::vector<package_id> {
auto mine = ranges::views::all(_sdists) //
| ranges::views::filter([&](const sdist& sd) {
return sd.manifest.pkg_id.name == name;
})
| ranges::views::transform(
[](const sdist& sd) { return sd.manifest.pkg_id; });
auto avail = ctlg.by_name(name);
auto all = ranges::views::concat(mine, avail) | ranges::to_vector;
ranges::sort(all, std::less<>{});
ranges::unique(all, std::less<>{});
return all;
},
[&](const package_id& pkg_id) {
auto found = find(pkg_id);
if (found) {
return found->manifest.dependencies;
}
return ctlg.dependencies_of(pkg_id);
});
const catalog& ctlg) const {
return dds::solve(
deps,
[&](std::string_view name) -> std::vector<package_id> {
auto mine = ranges::views::all(_sdists) //
| ranges::views::filter(
[&](const sdist& sd) { return sd.manifest.pkg_id.name == name; })
| ranges::views::transform([](const sdist& sd) { return sd.manifest.pkg_id; });
auto avail = ctlg.by_name(name);
auto all = ranges::views::concat(mine, avail) | ranges::to_vector;
ranges::sort(all, std::less<>{});
ranges::unique(all, std::less<>{});
return all;
},
[&](const package_id& pkg_id) {
auto found = find(pkg_id);
if (found) {
return found->manifest.dependencies;
}
return ctlg.dependencies_of(pkg_id);
});
}

+ 1
- 1
src/dds/repo/repo.hpp Parādīt failu

@@ -1,8 +1,8 @@
#pragma once

#include <dds/catalog/catalog.hpp>
#include <dds/sdist.hpp>
#include <dds/util/flock.hpp>
#include <dds/catalog/catalog.hpp>
#include <dds/util/fs.hpp>

#include <functional>

+ 7
- 6
src/dds/toolchain/from_dds.test.cpp Parādīt failu

@@ -44,12 +44,13 @@ void check_tc_compile(std::string_view tc_content,
}

TEST_CASE("Generating toolchain commands") {
check_tc_compile("Compiler-ID: GNU",
"g++ -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o",
"g++ -fPIC -fdiagnostics-color -pthread -Wall -Wextra -Wpedantic -Wconversion "
"-MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o",
"ar rcs stuff.a foo.o bar.o",
"g++ -fPIC -fdiagnostics-color foo.o bar.a -pthread -lstdc++fs -omeow.exe");
check_tc_compile(
"Compiler-ID: GNU",
"g++ -fPIC -fdiagnostics-color -pthread -MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o",
"g++ -fPIC -fdiagnostics-color -pthread -Wall -Wextra -Wpedantic -Wconversion "
"-MD -MF foo.o.d -MT foo.o -c foo.cpp -ofoo.o",
"ar rcs stuff.a foo.o bar.o",
"g++ -fPIC -fdiagnostics-color foo.o bar.a -pthread -lstdc++fs -omeow.exe");

check_tc_compile(
"Compiler-ID: GNU\nDebug: True",

+ 2
- 2
src/dds/toolchain/toolchain.cpp Parādīt failu

@@ -45,8 +45,8 @@ vector<string> toolchain::definition_args(std::string_view s) const noexcept {
return replace(_def_template, "<DEF>", s);
}

compile_command_info toolchain::create_compile_command(const compile_file_spec& spec) const
noexcept {
compile_command_info
toolchain::create_compile_command(const compile_file_spec& spec) const noexcept {
vector<string> flags;

using namespace std::literals;

+ 1
- 1
src/dds/util/algo.hpp Parādīt failu

@@ -1,9 +1,9 @@
#pragma once

#include <algorithm>
#include <functional>
#include <initializer_list>
#include <vector>
#include <functional>

namespace dds {


Notiek ielāde…
Atcelt
Saglabāt