| 108 | memcpy(state.isysroot, iosSysroot.bytesIncludingTerminator(), iosSysroot.sizeInBytesIncludingTerminator()); |
| 109 | setSysroot(iosSysroot); |
| 110 | } |
| 111 | |
| 112 | // Setup Compiler |
| 113 | SC_TRY(PluginCompiler::findBestCompiler(compiler)); |
| 114 | SC_TRY(PluginSysroot::findBestSysroot(compiler.type, sysroot)); |
| 115 | SC_TRY(state.includePathsText.assign(options.defaultIncludePathsText)); |
| 116 | SC_TRY(rebuildCompilerIncludePaths()); |
| 117 | |
| 118 | // Setup File System Watcher |
| 119 | fileSystemWatcherRunner.init(*eventLoop); |
| 120 | SC_TRY(fileSystemWatcher.init(fileSystemWatcherRunner)); |
| 121 | folderWatcher.notifyCallback.bind<HotReloadSystem, &HotReloadSystem::onFileChange>(*this); |
| 122 | SC_TRY(fileSystemWatcher.watch(folderWatcher, state.examplesPath.view())); |
| 123 | return Result(true); |
| 124 | } |
| 125 | |
| 126 | Result close() |
| 127 | { |
| 128 | Result result(true); |
| 129 | auto preserveFirstError = [&result](Result closeResult) |
| 130 | { |
| 131 | if (not closeResult and result) |
| 132 | { |
| 133 | result = closeResult; |
| 134 | } |
| 135 | }; |
| 136 | |
| 137 | preserveFirstError(fileSystemWatcher.close()); |
| 138 | if (eventLoop) |
| 139 | { |
| 140 | for (size_t idx = 0; idx < registry.getNumberOfEntries(); ++idx) |
nothing calls this directly
no test coverage detected