Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Fix cmake error when compiling with clang

Open Maks-s opened this issue 2 years ago • 2 comments

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

Maks-s avatar Nov 13 '22 13:11 Maks-s

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

bazuin-32 avatar Nov 13 '22 20:11 bazuin-32

agreed with @bazuin-32

vaxerski avatar Nov 15 '22 10:11 vaxerski

All done, thanks for the tip

Maks-s avatar Nov 21 '22 20:11 Maks-s