Fix glfw source path

This commit is contained in:
crazywhalecc 2025-06-12 10:58:58 +08:00
parent e2efaab2b2
commit bfba598ef4
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 32 additions and 21 deletions

View File

@ -11,9 +11,12 @@ use SPC\store\Config;
use SPC\store\Downloader;
use SPC\store\FileSystem;
use SPC\store\SourceManager;
use SPC\util\GlobalValueTrait;
abstract class LibraryBase
{
use GlobalValueTrait;
/** @var string */
public const NAME = 'unknown';
@ -31,7 +34,7 @@ abstract class LibraryBase
if (static::NAME === 'unknown') {
throw new RuntimeException('no unknown!!!!!');
}
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . static::NAME);
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . Config::getLib(static::NAME, 'source'));
}
/**
@ -328,26 +331,6 @@ abstract class LibraryBase
return false;
}
public function getBinDir(): string
{
return BUILD_BIN_PATH;
}
public function getIncludeDir(): string
{
return BUILD_INCLUDE_PATH;
}
public function getBuildRootPath(): string
{
return BUILD_ROOT_PATH;
}
public function getLibDir(): string
{
return BUILD_LIB_PATH;
}
/**
* Build this library.
*

View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace SPC\util;
trait GlobalValueTrait
{
public function getBinDir(): string
{
return BUILD_BIN_PATH;
}
public function getIncludeDir(): string
{
return BUILD_INCLUDE_PATH;
}
public function getBuildRootPath(): string
{
return BUILD_ROOT_PATH;
}
public function getLibDir(): string
{
return BUILD_LIB_PATH;
}
}