Skip to content

Force C11/C++17 compile (Fixes GCC 16 build)#1478

Open
cphlipot wants to merge 1 commit intoleejet:masterfrom
cphlipot:fix_gcc16_build
Open

Force C11/C++17 compile (Fixes GCC 16 build)#1478
cphlipot wants to merge 1 commit intoleejet:masterfrom
cphlipot:fix_gcc16_build

Conversation

@cphlipot
Copy link
Copy Markdown

@cphlipot cphlipot commented May 6, 2026

Currently the project requests the C11 and C++17 feature sets using
target_compile_features, however this only gaurentees us a minimum
C++ version of C++17, and allows compile to proceed with C++20
(the GCC 16 default) if it is already set.

Building Stable-diffusion.cpp with C++20 results in build failures
as std::u8string can no longer be assigned to std::string due to
C++20 standards changes.

Explictly set the required language standard to C++17 in order to
ensure we pass/fail the build consistently across compiler toolchains
even if compilers by default try to expose a superset of C++17
features.

Tested build now succeeds on Fedora 44 with GCC 16 using the
following commands for vulkan build from build.md:

mkdir build && cd build
cmake .. -DSD_VULKAN=ON
cmake --build . --config Release

Closes #1475

Currently the project requests the C11 and C++17 feature sets using
target_compile_features, however this only gaurentees us a minimum
C++ version of C++17, and allows compile to proceed with C++20
(the GCC 16 default) if it is already set.

Building Stable-diffusion.cpp with C++20 results in build failures
as std::u8string can no longer be assigned to std::string due to
C++20 standards changes.

Explictly set the required language standard to C++17 in order to
ensure we pass/fail the build consistently across compiler toolchains
even if compilers by default try to expose a superset of C++17
features.

Tested build succeeds on Fedora 44 with GCC 16.
@cphlipot cphlipot marked this pull request as ready for review May 6, 2026 21:57
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.

[Bug] Build failure on Fedora 44 (GCC 16)

1 participant