2023-08-18 18:17:52 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\macos\library;
|
|
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
|
// compile!
|
|
|
|
|
|
shell()->cd(SOURCE_PATH . '/ext-glfw/vendor/glfw')
|
2023-10-23 00:37:28 +08:00
|
|
|
|
->exec("cmake . {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF")
|
2023-08-18 18:17:52 +08:00
|
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
|
// patch pkgconf
|
|
|
|
|
|
$this->patchPkgconfPrefix(['glfw3.pc']);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|