macOS: Respect OSX_ARCHITECTURES for ASM

Fixes #20771.
This commit is contained in:
Raul Tambre
2020-08-21 10:57:32 +03:00
parent 692bc2de94
commit 940fc62962
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
asm-osx-architectures
---------------------
* The :prop_tgt:`OSX_ARCHITECTURES` target property is now respected for the
``ASM`` language.

View File

@@ -1875,8 +1875,9 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
if (this->Makefile->IsOn("APPLE") && this->EmitUniversalBinaryFlags) {
std::vector<std::string> archs;
target->GetAppleArchs(config, archs);
if (!archs.empty() && !lang.empty() &&
(lang[0] == 'C' || lang[0] == 'F' || lang[0] == 'O')) {
if (!archs.empty() &&
(lang == "C" || lang == "CXX" || lang == "OBJ" || lang == "OBJCXX" ||
cmHasLiteralPrefix(lang, "ASM"))) {
for (std::string const& arch : archs) {
if (filterArch.empty() || filterArch == arch) {
flags += " -arch ";