mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Fix glfw source path
This commit is contained in:
parent
e2efaab2b2
commit
bfba598ef4
@ -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.
|
||||
*
|
||||
|
||||
28
src/SPC/util/GlobalValueTrait.php
Normal file
28
src/SPC/util/GlobalValueTrait.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user