cnjinhao / nana

a modern C++ GUI library
https://nana.acemind.cn
Boost Software License 1.0
2.29k stars 331 forks source link

M1 compilation error #652

Open poterba opened 2 years ago

poterba commented 2 years ago

Tried to compile nana at AppleClang in Release configuration, got this: the clang compiler does not support '-march=native'

I'm pretty sure the guilty line is in compilers.cmake

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG")

but now I don't know what to do about it.

Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
kmilos commented 2 years ago

Just remove the line. The CMake default Release flags " -O3 -DNDEBUG" will apply and work fine, just make sure you have -D CMAKE_BUILD_TYPE=Release when you run cmake...

poterba commented 2 years ago

I know, but maybe it's better to include such condition into main code?