Home | History | Annotate | Download | only in Main
      1 # Copyright 2016 The SwiftShader Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #    http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 import("//ui/ozone/ozone.gni")
     16 import("../swiftshader.gni")
     17 
     18 # Need a separate config to ensure the warnings are added to the end.
     19 config("swiftshader_main_private_config") {
     20   if (is_win) {
     21     cflags = [
     22       "/wd4201",  # nameless struct/union
     23       "/wd5030",  # attribute is not recognized
     24     ]
     25 
     26     if (is_clang) {
     27       cflags += [
     28         "-Wno-string-conversion",
     29         "-Wno-sign-compare",
     30       ]
     31     }
     32   } else {
     33     cflags = [ "-msse2" ]
     34     defines =
     35         [ "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))" ]
     36   }
     37 }
     38 
     39 swiftshader_source_set("swiftshader_main") {
     40   deps = [
     41     "../Common:swiftshader_common",
     42   ]
     43 
     44   sources = [
     45     "Config.cpp",
     46     "FrameBuffer.cpp",
     47     "SwiftConfig.cpp",
     48   ]
     49 
     50   if (use_ozone && !is_win) {
     51     sources += [ "FrameBufferOzone.cpp" ]
     52   } else if (is_linux) {
     53     sources += [
     54       "FrameBufferX11.cpp",
     55       "libX11.cpp",
     56     ]
     57   } else if (is_mac) {
     58     sources += [ "FrameBufferOSX.mm" ]
     59   } else if (is_win) {
     60     sources += [
     61       "FrameBufferDD.cpp",
     62       "FrameBufferGDI.cpp",
     63       "FrameBufferWin.cpp",
     64     ]
     65   }
     66 
     67   if (is_win) {
     68     libs = [ "dxguid.lib" ]  # For FrameBufferDD
     69   }
     70 
     71   configs = [ ":swiftshader_main_private_config" ]
     72 
     73   include_dirs = [ ".." ]
     74 
     75   if (is_mac) {
     76     include_dirs += [ "../../include" ]
     77     libs = [
     78       "Quartz.framework",
     79       "Cocoa.framework",
     80     ]
     81   }
     82 }
     83