Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ link-libraries = [
"ghc_filesystem",
"mpark_variant",
"ordered_map",
"nlohmann_json"
"nlohmann_json",
]
cmake-after = """
generate_resources(${CMKR_TARGET})
Expand Down
4 changes: 2 additions & 2 deletions src/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include "project_parser.hpp"

#include "fs.hpp"
#include <sstream>
#include <cstddef>
#include <stdexcept>
#include <cstdlib>
#include <sstream>
#include <stdexcept>
#include <system_error>

namespace cmkr {
Expand Down
10 changes: 5 additions & 5 deletions src/cmake_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ 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;
}
ofs.flush();
ofs.close();
}

std::ofstream ofs2("cmake.toml");
std::ofstream ofs2("cmake.toml", std::ios::binary);
if (ofs2.is_open()) {
ofs2 << tomlbuf;
}
Expand Down Expand Up @@ -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!");
}
Expand Down Expand Up @@ -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());
}
Expand All @@ -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 {
Expand Down
Loading