From 191f084c9a3444a678e20a41ffe1fc6f546f0756 Mon Sep 17 00:00:00 2001 From: Christoph Hart <> Date: Fri, 24 Jan 2025 16:04:06 +0100 Subject: [PATCH] - fix macOS compilation with project directory with spaces --- hi_backend/backend/CompileExporter.cpp | 22 +++++++++++++++++----- hi_core/hi_modules/effects/fx/SlotFX.h | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/hi_backend/backend/CompileExporter.cpp b/hi_backend/backend/CompileExporter.cpp index 12a46c95f..6e774af9f 100644 --- a/hi_backend/backend/CompileExporter.cpp +++ b/hi_backend/backend/CompileExporter.cpp @@ -1190,9 +1190,13 @@ CompileExporter::ErrorCodes CompileExporter::compileSolution(BuildOption buildOp } #else - String permissionCommand = "chmod +x \"" + batchFile.getFullPathName() + "\""; - system(permissionCommand.getCharPointer()); - String command = manager != nullptr ? ("sh " + batchFile.getFullPathName()) : ("open " + batchFile.getFullPathName().quoted()); + if(manager != nullptr) + { + String permissionCommand = "chmod +x \"" + batchFile.getFullPathName() + "\""; + system(permissionCommand.getCharPointer()); + } + + String command = manager != nullptr ? batchFile.getFullPathName() : ("open " + batchFile.getFullPathName().quoted()); #endif @@ -1200,7 +1204,6 @@ CompileExporter::ErrorCodes CompileExporter::compileSolution(BuildOption buildOp #if JUCE_MAC if (globalCommandLineExport) { - Logger::writeToLog("Execute" + permissionCommand); Logger::writeToLog("Call " + command + " in order to compile the project"); return ErrorCodes::OK; @@ -1217,7 +1220,14 @@ CompileExporter::ErrorCodes CompileExporter::compileSolution(BuildOption buildOp { ChildProcess cp; - cp.start(command); +#if JUCE_MAC + StringArray com; + com.add("sh"); + com.add(command); + cp.start(com); +#else + cp.start(command); +#endif String currentLine; @@ -2019,6 +2029,7 @@ void CompileExporter::ProjectTemplateHelpers::handleVisualStudioVersion(const Hi auto shouldUseVS2017 = !(bool)HISE_USE_VS2022; +#if JUCE_WINDOWS if (isUsingVisualStudio2017 != shouldUseVS2017) { auto buildVersion = shouldUseVS2017 ? "VS2017" : "VS2022"; @@ -2032,6 +2043,7 @@ void CompileExporter::ProjectTemplateHelpers::handleVisualStudioVersion(const Hi PresetHandler::showMessageWindow("VS Version mismatch detected", message, PresetHandler::IconType::Warning); } +#endif if (isUsingVisualStudio2017) { diff --git a/hi_core/hi_modules/effects/fx/SlotFX.h b/hi_core/hi_modules/effects/fx/SlotFX.h index ab27094d3..2f21a8848 100644 --- a/hi_core/hi_modules/effects/fx/SlotFX.h +++ b/hi_core/hi_modules/effects/fx/SlotFX.h @@ -129,7 +129,7 @@ class HardcodedSwappableEffect : public HotswappableProcessor, bool hasLoadedButUncompiledEffect() const { #if USE_BACKEND - return currentEffect.isNotEmpty() && factory == nullptr || factory->getNumNodes() == 0; + return currentEffect.isNotEmpty() && (factory == nullptr || factory->getNumNodes() == 0); #else return false; #endif