| 214 | } |
| 215 | |
| 216 | static Result computeExecutableDirectory(const Project& project, const Parameters& parameters, |
| 217 | const Configuration& configuration, String& executableDirectory) |
| 218 | { |
| 219 | String outputDirectory = StringEncoding::Utf8; |
| 220 | SC_TRY(expandBuildDirectoryVariables(configuration.outputPath.view(), parameters, configuration, outputDirectory)); |
| 221 | |
| 222 | if (Path::isAbsolute(outputDirectory.view(), Path::AsNative)) |
| 223 | { |
| 224 | SC_TRY(executableDirectory.assign(outputDirectory.view())); |
| 225 | } |
| 226 | else |
| 227 | { |
| 228 | SC_TRY( |
| 229 | Path::join(executableDirectory, {parameters.directories.outputsDirectory.view(), outputDirectory.view()})); |
| 230 | } |
| 231 | |
| 232 | if (project.targetType == TargetType::GUIApplication and parameters.generator == Generator::XCode) |
| 233 | { |
| 234 | String bundleDirectory = StringEncoding::Utf8; |
| 235 | SC_TRY(StringBuilder::format(bundleDirectory, "{}.app", project.targetName.view())); |
| 236 | String fullDirectory = StringEncoding::Utf8; |
| 237 | SC_TRY(Path::join(fullDirectory, {executableDirectory.view(), bundleDirectory.view(), "Contents", "MacOS"})); |
| 238 | executableDirectory = move(fullDirectory); |
| 239 | } |
| 240 | return Result(true); |
| 241 | } |
| 242 | |
| 243 | static Result appendEscapedCString(StringBuilder& builder, StringView text) |
| 244 | { |