Closed gingerbeardman closed 2 months ago
I don't think this will cause any issues on other platforms.
If it does I'm sure we'll hear about it! :smile:
I suggest reverting this: CMAKE_OSX_ARCHITECTURES
should be set by user on cmake command line and should not be shoved down the user's throat. (@madebr would know better.)
I second what @sezero said. Making it a cache variable allows overriding it by users, but in X years, when Apple deprecates x86_64 support and no longer ships x86_64 toolchains, you will have to revert this commit.
cflags (e.g. -msse4 -mavx2
), ldflags (e.g. -static-libgcc -static-libstdc++
) and in this instance options to configure the architectures belong in cmake toolchain files.
set
is meant to be used in CMakeLists.txt filesI agree eventually it will need to be changed, if/when Apple abandon Intel and/or cmake breaks, but that's the way with software. No surprises.
So why remove it? I'm open minded.
In hindsight, I should have done:
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
endif()
Which might have been less offensive to the Linux crowd. Lesson learned!
This has nothing to do with Apple. The CMAKE_OSX_ARCHITECTURES
variable is osx/apple specific anyways.
This is about the principle that anything arch-specific should be left to the users.
For the same reasons, library authors are not adding -march=x86-64-v3
or -march=native
or -msse2 -mavx2
to the compile options.
This is something that should be added by the user itself, or for homebrew/Linux distros by the package maintainers.
You can't assume something that works for you is a good default for everyone.
I disagree, as you might expect.
Happy to leave it there.
I don't think this will cause any issues on other platforms.