Skip to content

Commit df99193

Browse files
committed
chore: wip
1 parent d9abd59 commit df99193

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/build-php.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ async function buildPhp(config: BuildConfig): Promise<string> {
12221222
// Update the environment with new paths
12231223
buildEnv.PKG_CONFIG_PATH = updatedPkgConfigPaths.join(':')
12241224
buildEnv.LDFLAGS = updatedLibPaths.map(path => `-L${path}`).join(' ')
1225+
buildEnv.CPPFLAGS = updatedIncludePaths.map(path => `-I${path}`).join(' ')
12251226

12261227
log(`✅ Updated paths after dependency installation`)
12271228
log(`✅ Found ${updatedLibPaths.length} library paths and ${updatedIncludePaths.length} include paths`)
@@ -1306,15 +1307,20 @@ async function buildPhp(config: BuildConfig): Promise<string> {
13061307
const rpathFlags = uniqueLibPaths.map(path => `-Wl,-rpath,${path}`).join(' ')
13071308

13081309
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(' ')
13091312
// Set up runtime library path for macOS (build-time only)
13101313
buildEnv.DYLD_LIBRARY_PATH = uniqueLibPaths.join(':')
13111314
buildEnv.LD = '/usr/bin/ld'
13121315
}
13131316
else {
13141317
// Linux: Use dynamic rpaths based on actual library locations, removing duplicates
13151318
const uniqueLibPaths = [...new Set(libPaths)]
1319+
const uniqueIncludePaths = [...new Set(includePaths)]
13161320
const rpathFlags = uniqueLibPaths.map(path => `-Wl,-rpath,${path}`).join(' ')
13171321
buildEnv.LDFLAGS += ` ${rpathFlags}`
1322+
// Update CPPFLAGS to use unique include paths for consistency
1323+
buildEnv.CPPFLAGS = uniqueIncludePaths.map(path => `-I${path}`).join(' ')
13181324
}
13191325

13201326
// Add Launchpad PATH to buildEnv if we're using Launchpad dependencies

0 commit comments

Comments
 (0)