Add WindowsCMakeExecutor

This commit is contained in:
crazywhalecc
2025-12-11 14:24:59 +08:00
parent f6b47ad810
commit 6d292b4c54
4 changed files with 258 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Package\Library;
use StaticPHP\Attribute\Package\BuildFor;
use StaticPHP\Attribute\Package\Library;
use StaticPHP\Package\LibraryPackage;
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
use StaticPHP\Util\FileSystem;
#[Library('onig')]
class onig
{
#[BuildFor('Windows')]
public function buildWin(LibraryPackage $package): void
{
WindowsCMakeExecutor::create($package)
->addConfigureArgs('-DMSVC_STATIC_RUNTIME=ON')
->build();
FileSystem::copy("{$package->getLibDir()}\\onig.lib", "{$package->getLibDir()}\\onig_a.lib");
}
}