Skip to content

Commit 864fa9d

Browse files
committed
1 parent a27f5cc commit 864fa9d

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/SPC/builder/extension/grpc.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public function patchBeforeBuildconf(): bool
2828
'zend_ce_exception,',
2929
);
3030

31+
// Fix include path conflict with pdo_sqlsrv: grpc's PHP ext dir is added to the global include path via
32+
$grpc_php_dir = "{$this->source_dir}/src/php/ext/grpc";
33+
if (file_exists("{$grpc_php_dir}/version.h")) {
34+
copy("{$grpc_php_dir}/version.h", "{$grpc_php_dir}/php_grpc_version.h");
35+
unlink("{$grpc_php_dir}/version.h");
36+
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.h", '#include "version.h"', '#include "php_grpc_version.h"');
37+
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.c", '#include "version.h"', '#include "php_grpc_version.h"');
38+
}
39+
3140
$config_m4 = <<<'M4'
3241
PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])])
3342

src/SPC/builder/unix/library/libjpeg.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ protected function build(): void
1414
->addConfigureArgs(
1515
'-DENABLE_STATIC=ON',
1616
'-DENABLE_SHARED=OFF',
17-
'-DWITH_SYSTEM_ZLIB=ON'
17+
'-DWITH_SYSTEM_ZLIB=ON',
18+
'-DWITH_TOOLS=OFF',
19+
'-DWITH_TESTS=OFF',
20+
'-DWITH_SIMD=OFF',
1821
)
1922
->build();
2023
// patch pkgconfig

src/SPC/util/executor/UnixCMakeExecutor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ private function makeCmakeToolchainFile(): string
183183
$cflags = getenv('SPC_DEFAULT_C_FLAGS');
184184
$cc = getenv('CC');
185185
$cxx = getenv('CCX');
186+
$include = BUILD_INCLUDE_PATH;
186187
logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'");
187188
$root = BUILD_ROOT_PATH;
188189
$pkgConfigExecutable = PkgConfigUtil::findPkgConfig();
@@ -210,6 +211,8 @@ private function makeCmakeToolchainFile(): string
210211
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
211212
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
212213
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
214+
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "{$include}")
215+
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "{$include}")
213216
set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil")
214217
CMAKE;
215218
// Whoops, linux may need CMAKE_AR sometimes

0 commit comments

Comments
 (0)