Skip to content

Commit a7184d0

Browse files
committed
Fix sqlsrv redundant cflags when building PHP
1 parent d535e4f commit a7184d0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/SPC/builder/extension/sqlsrv.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,14 @@ public function patchBeforeWindowsConfigure(): bool
3333
}
3434
return false;
3535
}
36+
37+
public function patchBeforeMake(): bool
38+
{
39+
$makefile = SOURCE_PATH . '\php-src\Makefile';
40+
$makeContent = file_get_contents($makefile);
41+
$makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/W4\b/m', '$1', $makeContent);
42+
$makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/WX\b/m', '$1', $makeContent);
43+
file_put_contents($makefile, $makeContent);
44+
return true;
45+
}
3646
}

0 commit comments

Comments
 (0)