mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Add extension parallel support (#444)
* Add extension parallel support * add parallel windows support * add parallel test * add zts limit for parallel * sort config * add parallel test * add dev-php test * use macos-13 instead of macos-latest * revert dev-php tests
This commit is contained in:
21
src/SPC/builder/extension/parallel.php
Normal file
21
src/SPC/builder/extension/parallel.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('parallel')]
|
||||
class parallel extends Extension
|
||||
{
|
||||
public function getConfigureArg(): string
|
||||
{
|
||||
if (!$this->builder->getOption('enable-zts')) {
|
||||
throw new WrongUsageException('ext-parallel must be built with ZTS builds. Use "--enable-zts" option!');
|
||||
}
|
||||
return parent::getConfigureArg(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
29
src/SPC/builder/windows/library/pthreads4w.php
Normal file
29
src/SPC/builder/windows/library/pthreads4w.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\windows\library;
|
||||
|
||||
class pthreads4w extends WindowsLibraryBase
|
||||
{
|
||||
public const NAME = 'pthreads4w';
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
cmd()->cd($this->source_dir)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper(
|
||||
'nmake /E /nologo /f Makefile ' .
|
||||
'DESTROOT=' . BUILD_ROOT_PATH . ' ' .
|
||||
'XCFLAGS="/MT" ' . // no dll
|
||||
'EHFLAGS="/I. /DHAVE_CONFIG_H /Os /Ob2 /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED"'
|
||||
),
|
||||
'pthreadVC3.inlined_static_stamp'
|
||||
);
|
||||
copy($this->source_dir . '\libpthreadVC3.lib', BUILD_LIB_PATH . '\libpthreadVC3.lib');
|
||||
copy($this->source_dir . '\_ptw32.h', BUILD_INCLUDE_PATH . '\_ptw32.h');
|
||||
copy($this->source_dir . '\pthread.h', BUILD_INCLUDE_PATH . '\pthread.h');
|
||||
copy($this->source_dir . '\sched.h', BUILD_INCLUDE_PATH . '\sched.h');
|
||||
copy($this->source_dir . '\semaphore.h', BUILD_INCLUDE_PATH . '\semaphore.h');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user