Skip to content

Commit c12472c

Browse files
authored
Merge pull request #180 from d06i/fix
fix #172
2 parents 8f4b376 + ffe08ae commit c12472c

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/cmake_generator.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ static std::string format(const char *format, const tsl::ordered_map<std::string
5454
return s;
5555
}
5656

57+
static std::string quoted( const std::string& str ){
58+
return "\"" + str + "\"";
59+
}
60+
61+
static std::string space_error_check( const std::string& str ){
62+
auto pos = str.find_last_of(' ');
63+
if ( pos != std::string::npos )
64+
return quoted(str) + " <------ !space(s)";
65+
else
66+
return quoted(str);
67+
}
68+
5769
static std::vector<fs::path> expand_cmake_path(const fs::path &source_path, const fs::path &toml_dir, bool is_root_project) {
5870
auto is_subdir = [](fs::path p, const fs::path &root) {
5971
while (true) {
@@ -1294,7 +1306,7 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
12941306
continue;
12951307
const auto &source_path = fs::path(path) / source;
12961308
if (!fs::exists(source_path)) {
1297-
throw_target_error("Source file not found: " + source);
1309+
throw_target_error("Source file not found: " + space_error_check(source) );
12981310
}
12991311
}
13001312
break;

0 commit comments

Comments
 (0)