| 60 | }; |
| 61 | |
| 62 | static Result buildHotReloadOptions(HotReloadOptionsStorage& storage) |
| 63 | { |
| 64 | StringPath executablePath; |
| 65 | SC_TRY_MSG(not FileSystem::Operations::getExecutablePath(executablePath).isEmpty(), |
| 66 | "SCExample could not resolve executable path"); |
| 67 | |
| 68 | String executableDirectory = StringEncoding::Utf8; |
| 69 | SC_TRY(executableDirectory.assign(Path::dirname(executablePath.view(), Path::AsNative))); |
| 70 | |
| 71 | const StringView compiledLibraryRoot = |
| 72 | StringView::fromNullTerminated(SC_COMPILER_LIBRARY_PATH, StringEncoding::Utf8); |
| 73 | const StringView compiledExtraIncludePaths = |
| 74 | StringView::fromNullTerminated(SC_HOT_RELOAD_INCLUDE_PATHS, StringEncoding::Utf8); |
| 75 | |
| 76 | String libraryRoot = StringEncoding::Utf8; |
| 77 | SC_TRY(resolveCompiledPathFromExecutableDirectory(compiledLibraryRoot, executableDirectory.view(), libraryRoot)); |
| 78 | |
| 79 | SC_TRY(Path::join(storage.examplesPath, {libraryRoot.view(), "Examples", "SCExample", "Examples"})); |
| 80 | String normalizedExamplesPath = StringEncoding::Utf8; |
| 81 | SC_TRY(Path::normalize(normalizedExamplesPath, storage.examplesPath.view(), Path::AsNative)); |
| 82 | storage.examplesPath = move(normalizedExamplesPath); |
| 83 | SC_TRY(appendLine(storage.defaultIncludePathsText, compiledLibraryRoot)); |
| 84 | SC_TRY(appendLine(storage.defaultIncludePathsText, compiledExtraIncludePaths)); |
| 85 | return Result(true); |
| 86 | } |
| 87 | |
| 88 | struct ApplicationState |
| 89 | { |
no test coverage detected