Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake error when compiling with clang #1009

Merged
merged 1 commit into from
Nov 21, 2022
Merged

Conversation

Maks-s
Copy link
Contributor

@Maks-s Maks-s commented Nov 13, 2022

Description

CMake build throws an error when compiling using clang :
error: invalid value 'c++23' in '-std=c++23'

This PR aims to fix this

How to reproduce

$ export CXX=clang++
$ cmake . build
$ ninja -C build # ERROR

Improvements

It could be improved to support other compilers, however gcc and clang should be enough for now

@bazuin-32
Copy link
Contributor

I'm pretty sure you could just do:

set(CMAKE_CXX_STANDARD 23)

and let cmake decide the appropriate flags for the compiler.
https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_STANDARD.html

@vaxerski
Copy link
Member

agreed with @bazuin-32

@Maks-s
Copy link
Contributor Author

Maks-s commented Nov 21, 2022

All done, thanks for the tip

@vaxerski vaxerski merged commit 88874fc into hyprwm:main Nov 21, 2022
scorpion-26 pushed a commit to scorpion-26/Hyprland that referenced this pull request Nov 22, 2022
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.

3 participants