cmake: avoid some duplications by using a helper
cmake: avoid some duplications by using a helper

Create a helper function to determine if we are targeting a Darwin SDK or not.
The repetition is error-prone and verbose.  Simplify by adding a checking
function.  NFC.

CodaFi/swift,felix91gr/swift,uasys/swift,jopamer/swift,tkremenek/swift,therealbnut/swift,bitjammer/swift,shahmishal/swift,shahmishal/swift,devincoughlin/swift,hooman/swift,rudkx/swift,lorentey/swift,uasys/swift,deyton/swift,russbishop/swift,Jnosh/swift,xwu/swift,CodaFi/swift,natecook1000/swift,IngmarStein/swift,tjw/swift,tinysun212/swift-windows,gottesmm/swift,zisko/swift,tkremenek/swift,tardieu/swift,jtbandes/swift,codestergit/swift,rudkx/swift,JaSpa/swift,karwa/swift,modocache/swift,lorentey/swift,devincoughlin/swift,brentdax/swift,milseman/swift,tardieu/swift,therealbnut/swift,OscarSwanros/swift,Jnosh/swift,jckarter/swift,tinysun212/swift-windows,atrick/swift,OscarSwanros/swift,apple/swift,frootloops/swift,airspeedswift/swift,arvedviehweger/swift,swiftix/swift,manavgabhawala/swift,JGiola/swift,hooman/swift,glessard/swift,xedin/swift,sschiau/swift,hughbe/swift,roambotics/swift,ahoppen/swift,shajrawi/swift,OscarSwanros/swift,karwa/swift,codestergit/swift,stephentyrone/swift,natecook1000/swift,felix91gr/swift,djwbrown/swift,kstaring/swift,calebd/swift,kperryua/swift,jmgc/swift,benlangmuir/swift,frootloops/swift,huonw/swift,jmgc/swift,uasys/swift,alblue/swift,deyton/swift,parkera/swift,CodaFi/swift,danielmartin/swift,manavgabhawala/swift,aschwaighofer/swift,JGiola/swift,jopamer/swift,austinzheng/swift,swiftix/swift,roambotics/swift,rudkx/swift,practicalswift/swift,aschwaighofer/swift,allevato/swift,atrick/swift,kstaring/swift,jtbandes/swift,huonw/swift,roambotics/swift,shajrawi/swift,allevato/swift,therealbnut/swift,jckarter/swift,gottesmm/swift,CodaFi/swift,therealbnut/swift,ahoppen/swift,jckarter/swift,xedin/swift,natecook1000/swift,stephentyrone/swift,return/swift,parkera/swift,nathawes/swift,jmgc/swift,ben-ng/swift,airspeedswift/swift,xedin/swift,amraboelela/swift,stephentyrone/swift,gribozavr/swift,practicalswift/swift,devincoughlin/swift,bitjammer/swift,aschwaighofer/swift,gregomni/swift,apple/swift,djwbrown/swift,rudkx/swift,sschiau/swift,hooman/swift,Jnosh/swift,brentdax/swift,felix91gr/swift,devincoughlin/swift,airspeedswift/swift,gribozavr/swift,devincoughlin/swift,arvedviehweger/swift,djwbrown/swift,ben-ng/swift,lorentey/swift,gmilos/swift,danielmartin/swift,parkera/swift,jckarter/swift,jmgc/swift,atrick/swift,practicalswift/swift,arvedviehweger/swift,shajrawi/swift,amraboelela/swift,xwu/swift,austinzheng/swift,brentdax/swift,jckarter/swift,jtbandes/swift,jtbandes/swift,jmgc/swift,jopamer/swift,parkera/swift,harlanhaskins/swift,roambotics/swift,IngmarStein/swift,practicalswift/swift,gmilos/swift,arvedviehweger/swift,jmgc/swift,return/swift,tjw/swift,lorentey/swift,austinzheng/swift,benlangmuir/swift,atrick/swift,modocache/swift,danielmartin/swift,sschiau/swift,alblue/swift,hughbe/swift,tardieu/swift,frootloops/swift,xedin/swift,shahmishal/swift,xwu/swift,manavgabhawala/swift,practicalswift/swift,Jnosh/swift,austinzheng/swift,calebd/swift,jopamer/swift,devincoughlin/swift,shajrawi/swift,glessard/swift,karwa/swift,gottesmm/swift,hughbe/swift,alblue/swift,bitjammer/swift,JaSpa/swift,swiftix/swift,hughbe/swift,airspeedswift/swift,danielmartin/swift,calebd/swift,huonw/swift,tardieu/swift,devincoughlin/swift,lorentey/swift,allevato/swift,parkera/swift,ben-ng/swift,tinysun212/swift-windows,amraboelela/swift,milseman/swift,gribozavr/swift,xwu/swift,russbishop/swift,milseman/swift,gribozavr/swift,gmilos/swift,russbishop/swift,JGiola/swift,sschiau/swift,benlangmuir/swift,roambotics/swift,JaSpa/swift,tinysun212/swift-windows,russbishop/swift,tardieu/swift,karwa/swift,uasys/swift,benlangmuir/swift,Jnosh/swift,shajrawi/swift,uasys/swift,harlanhaskins/swift,glessard/swift,swiftix/swift,lorentey/swift,calebd/swift,rudkx/swift,practicalswift/swift,kperryua/swift,airspeedswift/swift,russbishop/swift,return/swift,huonw/swift,zisko/swift,tinysun212/swift-windows,tkremenek/swift,parkera/swift,shajrawi/swift,harlanhaskins/swift,calebd/swift,djwbrown/swift,CodaFi/swift,hughbe/swift,aschwaighofer/swift,austinzheng/swift,apple/swift,gmilos/swift,austinzheng/swift,devincoughlin/swift,zisko/swift,djwbrown/swift,aschwaighofer/swift,jopamer/swift,gribozavr/swift,bitjammer/swift,gmilos/swift,benlangmuir/swift,xwu/swift,nathawes/swift,airspeedswift/swift,hooman/swift,xedin/swift,nathawes/swift,jopamer/swift,felix91gr/swift,kperryua/swift,parkera/swift,benlangmuir/swift,arvedviehweger/swift,jtbandes/swift,glessard/swift,tjw/swift,huonw/swift,natecook1000/swift,swiftix/swift,jtbandes/swift,tkremenek/swift,gmilos/swift,brentdax/swift,karwa/swift,xedin/swift,apple/swift,ahoppen/swift,manavgabhawala/swift,return/swift,stephentyrone/swift,russbishop/swift,danielmartin/swift,shahmishal/swift,xwu/swift,glessard/swift,alblue/swift,calebd/swift,stephentyrone/swift,nathawes/swift,uasys/swift,IngmarStein/swift,parkera/swift,tkremenek/swift,Jnosh/swift,kperryua/swift,practicalswift/swift,manavgabhawala/swift,shajrawi/swift,sschiau/swift,allevato/swift,modocache/swift,codestergit/swift,karwa/swift,zisko/swift,ben-ng/swift,manavgabhawala/swift,codestergit/swift,arvedviehweger/swift,gottesmm/swift,allevato/swift,kstaring/swift,glessard/swift,JaSpa/swift,huonw/swift,amraboelela/swift,natecook1000/swift,felix91gr/swift,hooman/swift,ahoppen/swift,nathawes/swift,frootloops/swift,gregomni/swift,allevato/swift,harlanhaskins/swift,tinysun212/swift-windows,rudkx/swift,deyton/swift,gottesmm/swift,gribozavr/swift,manavgabhawala/swift,JGiola/swift,IngmarStein/swift,therealbnut/swift,alblue/swift,kperryua/swift,huonw/swift,arvedviehweger/swift,xedin/swift,codestergit/swift,atrick/swift,milseman/swift,shahmishal/swift,kperryua/swift,apple/swift,karwa/swift,gregomni/swift,amraboelela/swift,airspeedswift/swift,IngmarStein/swift,codestergit/swift,brentdax/swift,sschiau/swift,xwu/swift,lorentey/swift,deyton/swift,brentdax/swift,JGiola/swift,kstaring/swift,zisko/swift,jckarter/swift,stephentyrone/swift,calebd/swift,ben-ng/swift,atrick/swift,amraboelela/swift,kstaring/swift,tjw/swift,CodaFi/swift,deyton/swift,amraboelela/swift,felix91gr/swift,xedin/swift,tjw/swift,shahmishal/swift,aschwaighofer/swift,felix91gr/swift,stephentyrone/swift,tardieu/swift,modocache/swift,nathawes/swift,zisko/swift,gribozavr/swift,frootloops/swift,CodaFi/swift,danielmartin/swift,tinysun212/swift-windows,hughbe/swift,IngmarStein/swift,ahoppen/swift,milseman/swift,jopamer/swift,JGiola/swift,gmilos/swift,milseman/swift,ben-ng/swift,zisko/swift,hughbe/swift,roambotics/swift,shahmishal/swift,natecook1000/swift,milseman/swift,karwa/swift,alblue/swift,gregomni/swift,return/swift,apple/swift,gribozavr/swift,djwbrown/swift,tjw/swift,deyton/swift,hooman/swift,modocache/swift,therealbnut/swift,harlanhaskins/swift,modocache/swift,tkremenek/swift,alblue/swift,austinzheng/swift,kstaring/swift,Jnosh/swift,JaSpa/swift,return/swift,natecook1000/swift,swiftix/swift,return/swift,practicalswift/swift,swiftix/swift,sschiau/swift,IngmarStein/swift,aschwaighofer/swift,gottesmm/swift,ben-ng/swift,OscarSwanros/swift,shajrawi/swift,deyton/swift,harlanhaskins/swift,jckarter/swift,therealbnut/swift,modocache/swift,OscarSwanros/swift,ahoppen/swift,OscarSwanros/swift,kperryua/swift,hooman/swift,gregomni/swift,brentdax/swift,sschiau/swift,tkremenek/swift,russbishop/swift,frootloops/swift,frootloops/swift,JaSpa/swift,allevato/swift,harlanhaskins/swift,JaSpa/swift,bitjammer/swift,bitjammer/swift,lorentey/swift,shahmishal/swift,bitjammer/swift,jtbandes/swift,tardieu/swift,nathawes/swift,kstaring/swift,djwbrown/swift,codestergit/swift,uasys/swift,OscarSwanros/swift,gottesmm/swift,danielmartin/swift,tjw/swift,jmgc/swift,gregomni/swift