Apple: Enable -Wl,-search_paths_first for non-macOS platforms

When building for Apple device platforms, don't expect
CMAKE_SYSTEM_VERSION to be set and don't set
DARWIN_MAJOR_VERSION. In turn, don't erroneously query the latter to
determine whether the -Wl,-search_paths_first linker flag is supported.
It is expected to be available for all Apple SDKs that we now support.

Projects may be relying on the linker flag not being added, so policy
CMP0123 provides backward compatibility for this change.
23 jobs for !5985 with ios-search-paths-first-linker-flag in 4 minutes and 4 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Build
manual #5677477
linux docker cmake build manual
build:centos6-x86_64
passed #5677474
linux docker cmake build
build:debian10-iwyu

00:03:48

manual #5677478
linux docker cmake build linux-3.17 manual
build:fedora33-ninja
passed #5677476
linux docker cmake build linux-3.17
build:fedora33-sphinx

00:04:03

passed #5677475
linux docker cmake build linux-3.17
build:fedora33-tidy

00:04:01

manual #5677480
cmake macos shell nonconcurrent xcode-12.4 manual
build:macos-x86_64-makefiles
manual #5677479
cmake macos shell nonconcurrent xcode-12.4 manual
build:macos-x86_64-ninja
manual #5677481
windows cmake shell vs2019 nonconcurrent msvc-19.28-16.9 manual
build:windows-vs2019-x64-ninja
 
  Test
created #5677482
linux docker cmake x11 linux-3.17
test:fedora33-ninja
created #5677484
cmake macos shell nonconcurrent xcode-12.4
test:macos-x86_64-makefiles
created #5677483
cmake macos shell nonconcurrent xcode-12.4
test:macos-x86_64-ninja
created #5677485
windows cmake shell vs2019 nonconcurrent msvc-19.28-16.9
test:windows-vs2019-x64-ninja
 
  Test Ext
created #5677488
linux docker cmake cuda-rt
test:cuda10.2-nvidia
created #5677486
linux docker cmake build linux-3.17
test:debian10-ninja
created #5677487
linux docker cmake build linux-3.17
test:fedora33-makefiles
created #5677489
linux docker cmake build linux-3.17
test:fedora33-ninja-multi
created #5677490
cmake macos shell concurrent xcode-12.4
test:macos-x86_64-xcode
created #5677491
windows cmake shell vs2019 concurrent msvc-19.28-16.9
test:windows-vs2019-x64
 
  External
passed cdash

passed ghostflow-check-master

passed cdash

passed cdash

passed cdash