[libFuzzer] [NFC] Support multi-arch and multi-OS building and testing

Differential Revision: https://reviews.llvm.org/D47296

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/fuzzer@334768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 085a981..1507608 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,9 +50,7 @@
   list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread)
 endif()
 
-if(APPLE)
-  set(FUZZER_SUPPORTED_OS osx)
-endif()
+set(FUZZER_SUPPORTED_OS ${SANITIZER_COMMON_SUPPORTED_OS})
 
 add_compiler_rt_object_libraries(RTfuzzer
   OS ${FUZZER_SUPPORTED_OS}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index cc3be7d..df5507f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,6 +6,10 @@
   -Werror
   -O2)
 
+if (APPLE)
+  set(FUZZER_SUPPORTED_OS osx)
+endif()
+
 add_custom_target(FuzzerUnitTests)
 set_target_properties(FuzzerUnitTests PROPERTIES FOLDER "Compiler-RT Tests")