mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 18:35:35 +08:00
add macos ldflags
This commit is contained in:
@@ -9,6 +9,7 @@ use SPC\builder\windows\WindowsBuilder;
|
|||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
use SPC\util\GlobalEnvManager;
|
use SPC\util\GlobalEnvManager;
|
||||||
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
#[CustomExt('grpc')]
|
#[CustomExt('grpc')]
|
||||||
class grpc extends Extension
|
class grpc extends Extension
|
||||||
@@ -28,6 +29,13 @@ class grpc extends Extension
|
|||||||
throw new \RuntimeException('Cannot find grpc source code');
|
throw new \RuntimeException('Cannot find grpc source code');
|
||||||
}
|
}
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/grpc/config.m4', 'PHP_ARG_ENABLE(grpc,', 'PHP_ARG_WITH(grpc,');
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/grpc/config.m4', 'PHP_ARG_ENABLE(grpc,', 'PHP_ARG_WITH(grpc,');
|
||||||
|
if (SPCTarget::getTargetOS() === 'Darwin') {
|
||||||
|
FileSystem::replaceFileRegex(
|
||||||
|
SOURCE_PATH . '/php-src/ext/grpc/config.m4',
|
||||||
|
'/GRPC_LIBDIR=.*$/m',
|
||||||
|
'GRPC_LIBDIR=' . BUILD_LIB_PATH . "\n" . 'LDFLAGS="$LDFLAGS -framework CoreFoundation"'
|
||||||
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user