Ensure a C compiler is found during configuration

In 248fd6d we added a lot of 3rd party C source files. That means
building SFML has the additional requirement of needing a C compiler.
I would expect that all of this would be properly handled by those
upstream projects properly telling CMake to find a C compiler but
apparently that is not the case.

By removing `LANGUAGES CXX` we are telling CMake to fall back to its
default behavior to find a C and C++ compiler.
This commit is contained in:
Chris Thrasher 2024-12-04 17:42:10 -07:00 committed by Lukas Dürrenberger
parent 0d05ed739c
commit f88b768ba6
2 changed files with 7 additions and 7 deletions

View File

@ -36,10 +36,10 @@ jobs:
- { name: Windows VS2022 ClangCL MSBuild, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -T ClangCL } # ninja doesn't support specifying the toolset, so use the ClangCL toolset to test building with MSBuild as well - { name: Windows VS2022 ClangCL MSBuild, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -T ClangCL } # ninja doesn't support specifying the toolset, so use the ClangCL toolset to test building with MSBuild as well
- { name: Windows VS2022 OpenGL ES, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DSFML_OPENGL_ES=ON -GNinja } - { name: Windows VS2022 OpenGL ES, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DSFML_OPENGL_ES=ON -GNinja }
- { name: Windows VS2022 Unity, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_UNITY_BUILD=ON -GNinja } - { name: Windows VS2022 Unity, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_UNITY_BUILD=ON -GNinja }
- { name: Windows LLVM/Clang, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_CXX_COMPILER=clang++ -GNinja } - { name: Windows LLVM/Clang, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja }
- { name: Windows MinGW, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_CXX_COMPILER=g++ -GNinja } - { name: Windows MinGW, os: windows-2022, flags: -DSFML_USE_MESA3D=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -GNinja }
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja } - { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja }
- { name: Linux Clang, os: ubuntu-22.04, flags: -DCMAKE_CXX_COMPILER=clang++ -GNinja , gcovr_options: '--gcov-executable="llvm-cov-$CLANG_VERSION gcov"' } - { name: Linux Clang, os: ubuntu-22.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja , gcovr_options: '--gcov-executable="llvm-cov-$CLANG_VERSION gcov"' }
- { name: Linux GCC DRM, os: ubuntu-22.04, flags: -DSFML_USE_DRM=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja } - { name: Linux GCC DRM, os: ubuntu-22.04, flags: -DSFML_USE_DRM=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja }
- { name: Linux GCC OpenGL ES, os: ubuntu-22.04, flags: -DSFML_OPENGL_ES=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja } - { name: Linux GCC OpenGL ES, os: ubuntu-22.04, flags: -DSFML_OPENGL_ES=ON -DSFML_RUN_DISPLAY_TESTS=OFF -GNinja }
- { name: macOS x64, os: macos-13, flags: -GNinja } - { name: macOS x64, os: macos-13, flags: -GNinja }
@ -60,7 +60,7 @@ jobs:
- platform: { name: Linux GCC, os: ubuntu-22.04 } - platform: { name: Linux GCC, os: ubuntu-22.04 }
config: { name: Static with PCH (GCC), flags: -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON } config: { name: Static with PCH (GCC), flags: -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON }
- platform: { name: Linux Clang, os: ubuntu-22.04 } - platform: { name: Linux Clang, os: ubuntu-22.04 }
config: { name: Static with PCH (Clang), flags: -GNinja -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON } config: { name: Static with PCH (Clang), flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=OFF -DSFML_ENABLE_PCH=ON }
- platform: { name: Linux GCC, os: ubuntu-22.04 } - platform: { name: Linux GCC, os: ubuntu-22.04 }
config: { name: Bundled Deps Static, flags: -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_USE_SYSTEM_DEPS=OFF } config: { name: Bundled Deps Static, flags: -GNinja -DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=OFF -DSFML_USE_SYSTEM_DEPS=OFF }
- platform: { name: Linux GCC, os: ubuntu-22.04 } - platform: { name: Linux GCC, os: ubuntu-22.04 }
@ -331,7 +331,7 @@ jobs:
echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH
- name: Configure - name: Configure
run: cmake --preset dev -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_UNITY_BUILD=ON ${{matrix.platform.flags}} run: cmake --preset dev -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_UNITY_BUILD=ON ${{matrix.platform.flags}}
- name: Analyze Code - name: Analyze Code
run: cmake --build build --target tidy run: cmake --build build --target tidy
@ -363,7 +363,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb fluxbox && sudo apt-get remove -y libasound2 run: sudo apt-get update && sudo apt-get install xorg-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb fluxbox && sudo apt-get remove -y libasound2
- name: Configure - name: Configure
run: cmake --preset dev -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -DSFML_BUILD_EXAMPLES=OFF -DSFML_ENABLE_SANITIZERS=ON ${{matrix.platform.flags}} run: cmake --preset dev -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSFML_BUILD_EXAMPLES=OFF -DSFML_ENABLE_SANITIZERS=ON ${{matrix.platform.flags}}
- name: Build - name: Build
run: cmake --build build run: cmake --build build

View File

@ -29,7 +29,7 @@ sfml_set_option(CMAKE_BUILD_TYPE Release STRING "Choose the type of build (Debug
sfml_set_option(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" STRING "The minimal iOS version that will be able to run the built binaries. Cannot be lower than 13.0") sfml_set_option(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" STRING "The minimal iOS version that will be able to run the built binaries. Cannot be lower than 13.0")
# project name # project name
project(SFML VERSION 3.0.0 LANGUAGES CXX) project(SFML VERSION 3.0.0)
set(VERSION_IS_RELEASE OFF) set(VERSION_IS_RELEASE OFF)