2023-08-18 18:17:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\macos\library;
|
|
|
|
|
|
2025-06-09 01:33:06 +08:00
|
|
|
use SPC\builder\unix\executor\UnixCMakeExecutor;
|
2023-08-20 19:51:45 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
|
2023-08-18 18:17:52 +08:00
|
|
|
class glfw extends MacOSLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'glfw';
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
2023-08-18 18:17:52 +08:00
|
|
|
{
|
2025-06-09 01:33:06 +08:00
|
|
|
UnixCMakeExecutor::create($this)
|
|
|
|
|
->setCMakeBuildDir("{$this->source_dir}/vendor/glfw")
|
|
|
|
|
->setReset(false)
|
|
|
|
|
->addConfigureArgs(
|
|
|
|
|
'-DGLFW_BUILD_EXAMPLES=OFF',
|
|
|
|
|
'-DGLFW_BUILD_TESTS=OFF',
|
|
|
|
|
)
|
|
|
|
|
->build('.');
|
2023-08-18 18:17:52 +08:00
|
|
|
// patch pkgconf
|
|
|
|
|
$this->patchPkgconfPrefix(['glfw3.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|