Skip to content

Commit bfba598

Browse files
committed
Fix glfw source path
1 parent e2efaab commit bfba598

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

src/SPC/builder/LibraryBase.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
use SPC\store\Downloader;
1212
use SPC\store\FileSystem;
1313
use SPC\store\SourceManager;
14+
use SPC\util\GlobalValueTrait;
1415

1516
abstract class LibraryBase
1617
{
18+
use GlobalValueTrait;
19+
1720
/** @var string */
1821
public const NAME = 'unknown';
1922

@@ -31,7 +34,7 @@ public function __construct(?string $source_dir = null)
3134
if (static::NAME === 'unknown') {
3235
throw new RuntimeException('no unknown!!!!!');
3336
}
34-
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . static::NAME);
37+
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . Config::getLib(static::NAME, 'source'));
3538
}
3639

3740
/**
@@ -328,26 +331,6 @@ public function patchBeforeMake(): bool
328331
return false;
329332
}
330333

331-
public function getBinDir(): string
332-
{
333-
return BUILD_BIN_PATH;
334-
}
335-
336-
public function getIncludeDir(): string
337-
{
338-
return BUILD_INCLUDE_PATH;
339-
}
340-
341-
public function getBuildRootPath(): string
342-
{
343-
return BUILD_ROOT_PATH;
344-
}
345-
346-
public function getLibDir(): string
347-
{
348-
return BUILD_LIB_PATH;
349-
}
350-
351334
/**
352335
* Build this library.
353336
*

src/SPC/util/GlobalValueTrait.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\util;
6+
7+
trait GlobalValueTrait
8+
{
9+
public function getBinDir(): string
10+
{
11+
return BUILD_BIN_PATH;
12+
}
13+
14+
public function getIncludeDir(): string
15+
{
16+
return BUILD_INCLUDE_PATH;
17+
}
18+
19+
public function getBuildRootPath(): string
20+
{
21+
return BUILD_ROOT_PATH;
22+
}
23+
24+
public function getLibDir(): string
25+
{
26+
return BUILD_LIB_PATH;
27+
}
28+
}

0 commit comments

Comments
 (0)