Refactor remaining cmake libs

This commit is contained in:
crazywhalecc
2025-06-09 01:33:06 +08:00
parent 37b9ccfaa8
commit 42943b315c
4 changed files with 55 additions and 85 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace SPC\builder\macos\library;
use SPC\builder\unix\executor\UnixCMakeExecutor;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
@@ -17,11 +18,14 @@ class glfw extends MacOSLibraryBase
*/
protected function build(): void
{
// compile
shell()->cd(SOURCE_PATH . '/ext-glfw/vendor/glfw')
->exec("cmake . {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF")
->exec("make -j{$this->builder->concurrency}")
->exec('make install');
UnixCMakeExecutor::create($this)
->setCMakeBuildDir("{$this->source_dir}/vendor/glfw")
->setReset(false)
->addConfigureArgs(
'-DGLFW_BUILD_EXAMPLES=OFF',
'-DGLFW_BUILD_TESTS=OFF',
)
->build('.');
// patch pkgconf
$this->patchPkgconfPrefix(['glfw3.pc']);
}