Add support for macOS

* Add 'macos' as an additional OS build option
* Guard unsupported paths like thread scheduling control and hwcaps
checking with the __APPLE__ macro
* Map linker options to respective Mach-O linker options

Change-Id: I67bd9fa3c20831427b218ca7d3b4b9d454ab4fec
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4788
Reviewed-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/SConscript b/SConscript
index d373227..229d7d1 100644
--- a/SConscript
+++ b/SConscript
@@ -137,7 +137,7 @@
 version_file = arm_compute_env.Command("src/core/arm_compute_version.embed", "", action=create_version_file)
 arm_compute_env.AlwaysBuild(version_file)
 
-default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++'
+default_cpp_compiler = 'g++' if env['os'] not in ['android', 'macos'] else 'clang++'
 cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
 
 # Generate embed files
@@ -171,7 +171,8 @@
 
 
 # Don't allow undefined references in the libraries:
-arm_compute_env.Append(LINKFLAGS=['-Wl,--no-undefined'])
+undefined_flag = '-Wl,-undefined,error' if 'macos' in arm_compute_env["os"] else '-Wl,--no-undefined'
+arm_compute_env.Append(LINKFLAGS=[undefined_flag])
 arm_compute_env.Append(CPPPATH =[Dir("./src/core/").path] )
 
 arm_compute_env.Append(LIBS = ['dl'])