Merge topic 'osx-archs-apple-only'

70ce1ad64a PCH: Avoid Apple-specific architecture flags on other platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5118
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 06c32fe..889ad7c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3124,6 +3124,9 @@
 void cmGeneratorTarget::GetAppleArchs(const std::string& config,
                                       std::vector<std::string>& archVec) const
 {
+  if (!this->Makefile->IsOn("APPLE")) {
+    return;
+  }
   cmProp archs = nullptr;
   if (!config.empty()) {
     std::string defVarName =