diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 855b1dc..1c2492c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,17 +208,32 @@ int buildProject(int argc, const _tinydir_char_t **argv) exit(10); } + if (!containsPlatform(sibsConfig.getPlatforms(), SYSTEM_PLATFORM)) + { + string errMsg = "The project "; + errMsg += sibsConfig.getPackageName(); + errMsg += " does not support your platform ("; + errMsg += asString(SYSTEM_PLATFORM); + errMsg += ")"; + cerr << errMsg << endl; + exit(11); + } + //string projectSrcPath = projectPath + "/src"; //validateDirectoryPath(projectSrcPath.c_str()); backend::Ninja ninja; FileWalkCallbackFunc collectSourceFiles = [&ninja, &sibsConfig, &collectSourceFiles](tinydir_file *file) { + FileString pathNative = file->path; +#if OS_FAMILY == OS_FAMILY_WINDOWS + replaceChar(pathNative, L'/', L'\\'); +#endif if(file->is_reg) { if (isSourceFile(file)) { - string filePathUtf8 = toUtf8(file->path + sibsConfig.getProjectPath().size()); + string filePathUtf8 = toUtf8(pathNative.c_str() + sibsConfig.getProjectPath().size()); ninja.addSourceFile(filePathUtf8.c_str()); } else @@ -229,9 +244,9 @@ int buildProject(int argc, const _tinydir_char_t **argv) else { // TODO: If compiling without "test" option, do not add test source dir to ninja. Ninja logic will then not build tests - if (!sibsConfig.getTestPath().empty() && isPathSubPathOf(file->path, sibsConfig.getTestPath())) + if (!sibsConfig.getTestPath().empty() && isPathSubPathOf(pathNative.c_str(), sibsConfig.getTestPath())) { - string filePathUtf8 = toUtf8(file->path); + string filePathUtf8 = toUtf8(pathNative.c_str()); ninja.addTestSourceDir(filePathUtf8.c_str()); } else |