File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 77use SPC \builder \linux \SystemUtil ;
88use SPC \exception \WrongUsageException ;
99use SPC \util \GlobalEnvManager ;
10+ use SPC \util \PkgConfigUtil ;
1011use SPC \util \SPCTarget ;
1112
1213class ToolchainManager
@@ -56,6 +57,15 @@ public static function afterInitToolchain(): void
5657 if (SPCTarget::getLibc () === 'glibc ' && SystemUtil::isMuslDist ()) {
5758 throw new WrongUsageException ('You are linking against glibc dynamically, which is only supported on glibc distros. ' );
5859 }
60+
61+ // init pkg-config for unix
62+ if (is_unix ()) {
63+ if (($ found = PkgConfigUtil::findPkgConfig ()) === null ) {
64+ throw new WrongUsageException ('Cannot find pkg-config executable. Please run `doctor` to fix this. ' );
65+ }
66+ GlobalEnvManager::putenv ("PKG_CONFIG= {$ found }" );
67+ }
68+
5969 $ toolchain = getenv ('SPC_TOOLCHAIN ' );
6070 /* @var ToolchainInterface $toolchain */
6171 $ instance = new $ toolchain ();
Original file line number Diff line number Diff line change @@ -122,14 +122,6 @@ public static function afterInit(): void
122122 self ::putenv ("YACC= {$ yacc }" );
123123 }
124124 }
125-
126- // init pkg-config for unix
127- if (is_unix ()) {
128- if (($ found = PkgConfigUtil::findPkgConfig ()) === null ) {
129- throw new WrongUsageException ('Cannot find pkg-config executable. Please run `doctor` to fix this. ' );
130- }
131- self ::putenv ("PKG_CONFIG= {$ found }" );
132- }
133125 }
134126
135127 private static function readIniFile (): array
You can’t perform that action at this time.
0 commit comments