Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/StaticPHP/Runtime/Executor/UnixCMakeExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,13 @@ private function makeCmakeToolchainFile(): string
$toolchain .= "\nset(CMAKE_CXX_STANDARD_LIBRARIES_INIT \"{$runtimeLibs}\")";
}
}
// Homebrew on Intel macOS installs into /usr/local, which sits on the compiler's
// default search path, so find_* resolves host headers ahead of the ones spc
// installed in buildroot and packages end up compiled against them (issue #1289).
// Ignoring the prefix keeps cmake's searches inside the buildroot on Darwin.
if (PHP_OS_FAMILY === 'Darwin') {
$toolchain .= "\nif(CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)\n set(CMAKE_IGNORE_PREFIX_PATH \"/usr/local\")\nendif()";
}
FileSystem::writeFile(SOURCE_PATH . '/toolchain.cmake', $toolchain);
return $created = realpath(SOURCE_PATH . '/toolchain.cmake');
}
Expand Down
Loading