@@ -1222,6 +1222,7 @@ async function buildPhp(config: BuildConfig): Promise<string> {
1222
1222
// Update the environment with new paths
1223
1223
buildEnv . PKG_CONFIG_PATH = updatedPkgConfigPaths . join ( ':' )
1224
1224
buildEnv . LDFLAGS = updatedLibPaths . map ( path => `-L${ path } ` ) . join ( ' ' )
1225
+ buildEnv . CPPFLAGS = updatedIncludePaths . map ( path => `-I${ path } ` ) . join ( ' ' )
1225
1226
1226
1227
log ( `✅ Updated paths after dependency installation` )
1227
1228
log ( `✅ Found ${ updatedLibPaths . length } library paths and ${ updatedIncludePaths . length } include paths` )
@@ -1306,15 +1307,20 @@ async function buildPhp(config: BuildConfig): Promise<string> {
1306
1307
const rpathFlags = uniqueLibPaths . map ( path => `-Wl,-rpath,${ path } ` ) . join ( ' ' )
1307
1308
1308
1309
buildEnv . LDFLAGS += ` -lresolv${ iconvFlag } ${ rpathFlags } -Wl,-headerpad_max_install_names`
1310
+ // Update CPPFLAGS to use filtered include paths for consistency
1311
+ buildEnv . CPPFLAGS = uniqueIncludePaths . map ( path => `-I${ path } ` ) . join ( ' ' )
1309
1312
// Set up runtime library path for macOS (build-time only)
1310
1313
buildEnv . DYLD_LIBRARY_PATH = uniqueLibPaths . join ( ':' )
1311
1314
buildEnv . LD = '/usr/bin/ld'
1312
1315
}
1313
1316
else {
1314
1317
// Linux: Use dynamic rpaths based on actual library locations, removing duplicates
1315
1318
const uniqueLibPaths = [ ...new Set ( libPaths ) ]
1319
+ const uniqueIncludePaths = [ ...new Set ( includePaths ) ]
1316
1320
const rpathFlags = uniqueLibPaths . map ( path => `-Wl,-rpath,${ path } ` ) . join ( ' ' )
1317
1321
buildEnv . LDFLAGS += ` ${ rpathFlags } `
1322
+ // Update CPPFLAGS to use unique include paths for consistency
1323
+ buildEnv . CPPFLAGS = uniqueIncludePaths . map ( path => `-I${ path } ` ) . join ( ' ' )
1318
1324
}
1319
1325
1320
1326
// Add Launchpad PATH to buildEnv if we're using Launchpad dependencies
0 commit comments