From 156fc961ec2e8aa30c306465e0421c493133b06c Mon Sep 17 00:00:00 2001 From: Peter Meerwald-Stadler Date: Fri, 10 Dec 2021 17:39:36 +0100 Subject: [PATCH] Ceating a directory with no name apparently fails on Linux, but silently succeeds on Windows --- src/cmake_generator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmake_generator.cpp b/src/cmake_generator.cpp index 8a0ab8d..cbc290d 100644 --- a/src/cmake_generator.cpp +++ b/src/cmake_generator.cpp @@ -494,7 +494,9 @@ int generate_cmake(const char *path, const parser::Project *parent_project) { fs::path cmkr_include(project.cmkr_include); if (!project.cmkr_include.empty() && !fs::exists(cmkr_include) && cmkr_include.is_relative()) { - fs::create_directories(cmkr_include.parent_path()); + if (!cmkr_include.parent_path().empty()) { + fs::create_directories(cmkr_include.parent_path()); + } std::ofstream ofs(cmkr_include.string(), std::ios::binary); if (!ofs) { throw std::runtime_error("Failed to create " + project.cmkr_include);