Skip to content

PCBC-1053: Fix CC compiler flags bleeding into CMAKE_C_COMPILER on macOS#251

Merged
avsej merged 1 commit intocouchbase:mainfrom
avsej:PCBC-1053-fix-macos-build
Mar 27, 2026
Merged

PCBC-1053: Fix CC compiler flags bleeding into CMAKE_C_COMPILER on macOS#251
avsej merged 1 commit intocouchbase:mainfrom
avsej:PCBC-1053-fix-macos-build

Conversation

@avsej
Copy link
Copy Markdown
Member

@avsej avsej commented Mar 27, 2026

phpize on macOS can set CC to a compound string like 'cc -std=gnu23', concatenating the standard flag directly onto the compiler path. CMake rejects this as CMAKE_C_COMPILER because it is not a bare path.

Apply the same flag-stripping logic that already existed for CXX to CC as well: detect when CC contains flags, extract the bare path into CC_PATH, substitute it back, and pass CC_PATH directly to -DCMAKE_C_COMPILER in Makefile.frag instead of relying on the
GNU make function.

@avsej avsej requested review from DemetrisChr and Matt-Woz March 27, 2026 15:50
phpize on macOS can set CC to a compound string like 'cc -std=gnu23',
concatenating the standard flag directly onto the compiler path. CMake
rejects this as CMAKE_C_COMPILER because it is not a bare path.

Apply the same flag-stripping logic that already existed for CXX to CC
as well: detect when CC contains flags, extract the bare path into
CC_PATH, substitute it back, and pass CC_PATH directly to
-DCMAKE_C_COMPILER in Makefile.frag instead of relying on the
 GNU make function.
@avsej avsej merged commit 9b4d7fc into couchbase:main Mar 27, 2026
128 of 136 checks passed
@avsej avsej deleted the PCBC-1053-fix-macos-build branch March 27, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants