mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
Add ext-glfw support for Windows
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
glfw:
|
glfw:
|
||||||
type: library
|
type: library
|
||||||
artifact: glfw
|
artifact: glfw
|
||||||
|
headers:
|
||||||
|
- GLFW/glfw3.h
|
||||||
|
- GLFW/glfw3native.h
|
||||||
lang: cpp
|
lang: cpp
|
||||||
static-libs@unix:
|
static-libs@unix:
|
||||||
- libglfw3.a
|
- libglfw3.a
|
||||||
|
static-libs@windows:
|
||||||
|
- glfw3.lib
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use StaticPHP\Util\FileSystem;
|
|||||||
class glfw extends PhpExtensionPackage
|
class glfw extends PhpExtensionPackage
|
||||||
{
|
{
|
||||||
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-glfw')]
|
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-glfw')]
|
||||||
|
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-glfw')]
|
||||||
#[PatchDescription('Patch glfw extension before buildconf')]
|
#[PatchDescription('Patch glfw extension before buildconf')]
|
||||||
public function patchBeforeBuildconf(): void
|
public function patchBeforeBuildconf(): void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use StaticPHP\Exception\BuildFailureException;
|
|||||||
use StaticPHP\Exception\ValidationException;
|
use StaticPHP\Exception\ValidationException;
|
||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
|
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
|
||||||
|
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
||||||
use StaticPHP\Runtime\SystemTarget;
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||||
|
|
||||||
@@ -97,4 +98,19 @@ class glfw
|
|||||||
// patch pkgconf
|
// patch pkgconf
|
||||||
$lib->patchPkgconfPrefix(['glfw3.pc']);
|
$lib->patchPkgconfPrefix(['glfw3.pc']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[BuildFor('Windows')]
|
||||||
|
public function buildForWin(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
WindowsCMakeExecutor::create($lib)
|
||||||
|
->setWorkingDir("{$lib->getSourceDir()}/vendor/glfw")
|
||||||
|
->setBuildDir("{$lib->getSourceDir()}/vendor/glfw")
|
||||||
|
->setReset(false)
|
||||||
|
->addConfigureArgs(
|
||||||
|
'-DGLFW_BUILD_EXAMPLES=OFF',
|
||||||
|
'-DGLFW_BUILD_TESTS=OFF',
|
||||||
|
'-DGLFW_BUILD_DOCS=OFF',
|
||||||
|
)
|
||||||
|
->build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user