Skip to content

Commit 156fc96

Browse files
committed
Ceating a directory with no name apparently fails on Linux, but silently succeeds on Windows
1 parent 1c23469 commit 156fc96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmake_generator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ int generate_cmake(const char *path, const parser::Project *parent_project) {
494494

495495
fs::path cmkr_include(project.cmkr_include);
496496
if (!project.cmkr_include.empty() && !fs::exists(cmkr_include) && cmkr_include.is_relative()) {
497-
fs::create_directories(cmkr_include.parent_path());
497+
if (!cmkr_include.parent_path().empty()) {
498+
fs::create_directories(cmkr_include.parent_path());
499+
}
498500
std::ofstream ofs(cmkr_include.string(), std::ios::binary);
499501
if (!ofs) {
500502
throw std::runtime_error("Failed to create " + project.cmkr_include);

0 commit comments

Comments
 (0)