Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 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 | # Need a separate config to ensure the warnings are added to the end. |
| 16 | config("swiftshader_main_private_config") { |
Alexis Hetu | 03b67af | 2016-08-31 17:25:40 -0400 | [diff] [blame] | 17 | if (is_win) { |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 18 | cflags = [ "/wd4201" ] # nameless struct/union |
Alexis Hetu | 03b67af | 2016-08-31 17:25:40 -0400 | [diff] [blame] | 19 | |
| 20 | if (is_clang) { |
| 21 | cflags += [ |
Alexis Hetu | 03b67af | 2016-08-31 17:25:40 -0400 | [diff] [blame] | 22 | "-Wno-string-conversion", |
| 23 | "-Wno-sign-compare", |
| 24 | ] |
| 25 | } |
| 26 | } else { |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 27 | cflags = [ |
| 28 | "-DLOG_TAG=\"swiftshader_main\"", |
| 29 | "-msse2", |
| 30 | ] |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | |
| 34 | source_set("swiftshader_main") { |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 35 | deps = [ |
| 36 | "../Common:swiftshader_common", |
| 37 | ] |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 38 | |
| 39 | sources = [ |
| 40 | "Config.cpp", |
| 41 | "FrameBuffer.cpp", |
| 42 | "SwiftConfig.cpp", |
| 43 | ] |
| 44 | |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 45 | if (is_linux) { |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 46 | sources += [ |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 47 | "FrameBufferX11.cpp", |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 48 | "libX11.cpp", |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 49 | ] |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 50 | } else if (is_mac) { |
| 51 | sources += [ "FrameBufferOSX.mm" ] |
| 52 | } else if (is_win) { |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 53 | sources += [ |
| 54 | "FrameBufferDD.cpp", |
| 55 | "FrameBufferGDI.cpp", |
| 56 | "FrameBufferWin.cpp", |
| 57 | ] |
| 58 | } |
| 59 | |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 60 | if (is_win) { |
| 61 | configs -= [ "//build/config/win:unicode" ] |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 62 | libs = [ "dxguid.lib" ] # For FrameBufferDD |
Alexis Hetu | 46c1b91 | 2016-06-23 11:06:46 -0400 | [diff] [blame] | 63 | } |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 64 | |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 65 | configs += [ ":swiftshader_main_private_config" ] |
Alexis Hetu | 91f10e3 | 2016-06-07 19:53:42 -0400 | [diff] [blame] | 66 | |
| 67 | include_dirs = [ |
| 68 | "..", |
| 69 | "../Common", |
| 70 | ] |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 71 | |
| 72 | if (is_mac) { |
| 73 | include_dirs += [ "../../include" ] |
| 74 | libs = [ |
| 75 | "Quartz.framework", |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 76 | "Cocoa.framework", |
Alexis Hetu | 8be4110 | 2016-09-12 17:45:55 -0400 | [diff] [blame] | 77 | ] |
| 78 | } |
Alexis Hetu | d6d10f9 | 2016-11-22 13:47:04 -0500 | [diff] [blame] | 79 | } |