OSDN Git Service

Eliminate unnecessary inverse masks.
[android-x86/external-swiftshader.git] / CMakeLists.txt
index 5368fe4..619111f 100644 (file)
@@ -2,6 +2,38 @@ cmake_minimum_required(VERSION 2.8)
 
 project(SwiftShader C CXX)
 
+###########################################################
+# Detect system
+###########################################################
+
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+    set(LINUX ON)
+elseif(WIN32)
+elseif(APPLE)
+else()
+    message(FATAL_ERROR "Platform is not supported")
+endif()
+
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        set(ARCH "aarch64")
+    else()
+        set(ARCH "arm")
+    endif()
+else()
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        set(ARCH "x86_64")
+    else()
+        set(ARCH "x86")
+    endif()
+endif()
+
+set(CMAKE_MACOSX_RPATH ON)
+
+###########################################################
+# Options
+###########################################################
+
 if(NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build: Debug Release MinSizeRel RelWithDebInfo." FORCE)
 endif()
@@ -19,7 +51,13 @@ option(USE_GROUP_SOURCES "Group the source files in a folder tree for Visual Stu
 option(BUILD_SAMPLES "Build sample programs" 1)
 option(BUILD_TESTS "Build test programs" 1)
 
-set(REACTOR_BACKEND "LLVM" CACHE STRING "JIT compiler back-end used by Reactor")
+if(ARCH STREQUAL "arm")
+    set(DEFAULT_REACTOR_BACKEND "Subzero")
+else()
+    set(DEFAULT_REACTOR_BACKEND "LLVM")
+endif()
+
+set(REACTOR_BACKEND DEFAULT_REACTOR_BACKEND CACHE STRING "JIT compiler back-end used by Reactor")
 set_property(CACHE REACTOR_BACKEND PROPERTY STRINGS LLVM Subzero)
 
 # LLVM disallows calling cmake . from the main LLVM dir, the reason is that
@@ -38,34 +76,6 @@ endif()
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
 ###########################################################
-# Detect system
-###########################################################
-
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
-    set(LINUX ON)
-elseif(WIN32)
-elseif(APPLE)
-else()
-    message(FATAL_ERROR "Platform is not supported")
-endif()
-
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch")
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-        set(ARCH "aarch64")
-    else()
-        set(ARCH "arm")
-    endif()
-else()
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-        set(ARCH "x86_64")
-    else()
-        set(ARCH "x86")
-    endif()
-endif()
-
-set(CMAKE_MACOSX_RPATH ON)
-
-###########################################################
 # Convenience macros
 ###########################################################