| 276 | } |
| 277 | |
| 278 | static Result addCompiledLibraryRootDefine(Project& project, const Parameters& parameters) |
| 279 | { |
| 280 | for (Configuration& configuration : project.configurations) |
| 281 | { |
| 282 | String executableDirectory = StringEncoding::Utf8; |
| 283 | SC_TRY(computeExecutableDirectory(project, parameters, configuration, executableDirectory)); |
| 284 | |
| 285 | String relativeRoot = StringEncoding::Utf8; |
| 286 | SC_TRY(Path::relativeFromTo(relativeRoot, executableDirectory.view(), project.rootDirectory.view(), |
| 287 | Path::AsNative, Path::AsNative)); |
| 288 | SC_TRY(normalizeRelativePathForCompileDefine(relativeRoot)); |
| 289 | |
| 290 | String define = StringEncoding::Utf8; |
| 291 | SC_TRY(StringBuilder::format(define, "SC_LIBRARY_ROOT={}", relativeRoot.view())); |
| 292 | SC_TRY(configuration.compile.defines.push_back(move(define))); |
| 293 | } |
| 294 | return Result(true); |
| 295 | } |
| 296 | |
| 297 | static Result addHotReloadIncludePathsDefine(Project& project, const Parameters& parameters, StringView imguiDirectory) |
| 298 | { |
no test coverage detected