File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 77use StaticPHP \Attribute \Package \BuildFor ;
88use StaticPHP \Attribute \Package \Library ;
99use StaticPHP \Attribute \Package \PatchBeforeBuild ;
10+ use StaticPHP \Attribute \PatchDescription ;
1011use StaticPHP \Exception \BuildFailureException ;
1112use StaticPHP \Exception \EnvironmentException ;
1213use StaticPHP \Package \LibraryPackage ;
1920class libsodium
2021{
2122 #[PatchBeforeBuild]
23+ #[PatchDescription('Replace SODIUM_STATIC define guard with unconditional #if 1 for MSVC static linking ' )]
2224 public function patchBeforeBuild (LibraryPackage $ lib ): void
2325 {
24- if (SystemTarget::getTargetOS () === 'Windows ' ) {
25- FileSystem::replaceFileStr ("{$ lib ->getSourceDir ()}\\src \\libsodium \\include \\sodium \\export.h " , '#ifdef SODIUM_STATIC ' , '#if 1 ' );
26- }
26+ spc_skip_if (SystemTarget::getTargetOS () !== 'Windows ' , 'This patch is only for Windows builds. ' );
27+ FileSystem::replaceFileStr ($ lib ->getSourceDir () . '\src\libsodium\include\sodium\export.h ' , '#ifdef SODIUM_STATIC ' , '#if 1 ' );
2728 }
2829
2930 #[BuildFor('Linux ' )]
You can’t perform that action at this time.
0 commit comments