Skip to content

fix(build): Pass the compiler target to the symbol generator - #976

Open
jobor wants to merge 1 commit into
pnggroup:libpng18from
jobor:genout-compilet-target
Open

jobor wants to merge 1 commit into
pnggroup:libpng18from
jobor:genout-compilet-target

Conversation

@jobor

@jobor jobor commented Nov 4, 2026

Copy link
Copy Markdown

genout.cmake invokes the C compiler directly via execute_process, so CMAKE_C_COMPILER_TARGET, which CMake otherwise turns into --target=, is not applied. When cross-compiling with clang and a toolchain that relies on that variable (for example OpenHarmony), the preprocessor runs for the host target and fails to find the target's sysroot headers:

fatal error: 'bits/alltypes.h' file not found

Forward the target to the compiler for Clang-based compilers only, since GCC rejects --target=.

genout.cmake invokes the C compiler directly via execute_process, so
CMAKE_C_COMPILER_TARGET, which CMake otherwise turns into --target=,
is not applied. When cross-compiling with clang and a toolchain that
relies on that variable (for example OpenHarmony), the preprocessor
runs for the host target and fails to find the target's sysroot
headers:

  fatal error: 'bits/alltypes.h' file not found

Forward the target to the compiler for Clang-based compilers only,
since GCC rejects --target=.
@jobor jobor mentioned this pull request Nov 4, 2026
7 tasks done
@jobor

jobor commented Nov 4, 2026

Copy link
Copy Markdown
Author

This resulted from microsoft/vcpkg#54850

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.

1 participant