Some minor fixes related to newlines and formatting

toml-checker
Duncan Ogilvie 2 years ago
parent 09c9c28934
commit 77f4bf7da0

@ -35,7 +35,7 @@ link-libraries = [
"ghc_filesystem",
"mpark_variant",
"ordered_map",
"nlohmann_json"
"nlohmann_json",
]
cmake-after = """
generate_resources(${CMKR_TARGET})

@ -119,7 +119,7 @@ int generate_project(const char *str) {
const auto tomlbuf = format(cmake_toml, dir_name.c_str(), dir_name.c_str(), str, installed.c_str(), target.c_str(), dest.c_str());
if (strcmp(str, "interface")) {
std::ofstream ofs("src/main.cpp");
std::ofstream ofs("src/main.cpp", std::ios::binary);
if (ofs.is_open()) {
ofs << mainbuf;
}
@ -127,7 +127,7 @@ int generate_project(const char *str) {
ofs.close();
}
std::ofstream ofs2("cmake.toml");
std::ofstream ofs2("cmake.toml", std::ios::binary);
if (ofs2.is_open()) {
ofs2 << tomlbuf;
}
@ -607,7 +607,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
j["description"] = project.project_description;
}
std::ofstream ofs("vcpkg.json");
std::ofstream ofs("vcpkg.json", std::ios::binary);
if (!ofs) {
throw std::runtime_error("Failed to create a vcpkg.json manifest file!");
}
@ -900,7 +900,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
if (!fs::exists(list_path))
return true;
std::ifstream ifs(list_path, std::ios_base::binary);
std::ifstream ifs(list_path, std::ios::binary);
if (!ifs.is_open()) {
throw std::runtime_error("Failed to read " + list_path.string());
}
@ -910,7 +910,7 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
}();
if (should_regenerate) {
std::ofstream ofs(list_path, std::ios_base::binary);
std::ofstream ofs(list_path, std::ios::binary);
if (ofs.is_open()) {
ofs << ss.str();
} else {

@ -182,7 +182,7 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
for (const auto &itr : sets) {
Setting s;
s.name = itr.first;
const auto& value = itr.second;
const auto &value = itr.second;
if (value.is_boolean()) {
s.val = value.as_boolean();
} else if (value.is_string()) {
@ -213,7 +213,7 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
for (const auto &itr : opts) {
Option o;
o.name = itr.first;
const auto& value = itr.second;
const auto &value = itr.second;
if (value.is_boolean()) {
o.val = value.as_boolean();
} else {
@ -232,7 +232,7 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
for (const auto &itr : pkgs) {
Package p;
p.name = itr.first;
const auto& value = itr.second;
const auto &value = itr.second;
if (itr.second.is_string()) {
p.version = itr.second.as_string();
} else {
@ -283,7 +283,7 @@ Project::Project(const Project *parent, const std::string &path, bool build) {
const auto &ts = toml::find(toml, "target").as_table();
for (const auto &itr : ts) {
const auto& value = itr.second;
const auto &value = itr.second;
Target target;
target.name = itr.first;

@ -1,11 +1,11 @@
{
"$cmkr": "This file is automatically generated from cmake.toml - DO NOT EDIT",
"$cmkr-url": "https://github.com/build-cpp/cmkr",
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"dependencies": [
"fmt"
],
"description": "Dependencies from vcpkg",
"name": "vcpkg",
"version-string": ""
}
{
"$cmkr": "This file is automatically generated from cmake.toml - DO NOT EDIT",
"$cmkr-url": "https://github.com/build-cpp/cmkr",
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"dependencies": [
"fmt"
],
"description": "Dependencies from vcpkg",
"name": "vcpkg",
"version-string": ""
}

Loading…
Cancel
Save