Skip to content

Commit 6122d22

Browse files
authored
Fix backslash path in MSYS2 (#418)
* force forward slash in Makefile path * converting extSrcPaths to fs::path avoid converting to string and back to fs::path
1 parent f428895 commit 6122d22

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

commandLine/src/projects/baseProject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,13 @@ bool baseProject::save(){
263263
if( projectDir.string().rfind(getOFRoot().string(), 0) == 0) {
264264
path = getOFRelPath(projectDir);
265265
}
266-
saveConfig << "OF_ROOT = " << path.string() << std::endl;
266+
saveConfig << "OF_ROOT = " << path.generic_string() << std::endl;
267267
}
268268
// replace this section with our external paths
269269
else if( extSrcPaths.size() && str.rfind("# PROJECT_EXTERNAL_SOURCE_PATHS =", 0) == 0 ){
270270
for(int d = 0; d < extSrcPaths.size(); d++){
271-
ofLog(OF_LOG_VERBOSE) << " adding PROJECT_EXTERNAL_SOURCE_PATHS to config" << extSrcPaths[d] << std::endl;
272-
saveConfig << "PROJECT_EXTERNAL_SOURCE_PATHS" << (d == 0 ? " = " : " += ") << extSrcPaths[d] << std::endl;
271+
ofLog(OF_LOG_VERBOSE) << " adding PROJECT_EXTERNAL_SOURCE_PATHS to config" << extSrcPaths[d].generic_string() << std::endl;
272+
saveConfig << "PROJECT_EXTERNAL_SOURCE_PATHS" << (d == 0 ? " = " : " += ") << extSrcPaths[d].generic_string() << std::endl;
273273
}
274274
} else {
275275
saveConfig << str << std::endl;
@@ -519,7 +519,7 @@ void baseProject::addSrcRecursively(const fs::path & srcPath){
519519
fs::path base = srcPath.parent_path();
520520
// alert("base = " + base.string());
521521

522-
extSrcPaths.emplace_back(srcPath.string());
522+
extSrcPaths.emplace_back(srcPath);
523523
vector < fs::path > srcFilesToAdd;
524524
getFilesRecursively(srcPath, srcFilesToAdd);
525525
// bool isRelative = ofIsPathInPath(fs::absolute(srcPath), getOFRoot());

commandLine/src/projects/baseProject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class baseProject {
9292
bool recursiveCopy(const fs::path & srcDir, const fs::path & destDir);
9393

9494
std::vector<ofAddon> addons;
95-
std::vector<std::string> extSrcPaths;
95+
std::vector<fs::path> extSrcPaths;
9696

9797
//cached addons - if an addon is requested more than once, avoid loading from disk as it's quite slow
9898
std::unordered_map<std::string,std::unordered_map<std::string, ofAddon>> addonsCache; //indexed by [platform][supplied path]

0 commit comments

Comments
 (0)