blob: 1206be38f14cd52d0e45fc0eda0ac6c361b1fa02 [file] [log] [blame]
Alexis Hetu91f10e32016-06-07 19:53:42 -04001# 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.
16config("swiftshader_main_private_config") {
Alexis Hetu03b67af2016-08-31 17:25:40 -040017 if (is_win) {
Alexis Hetud6d10f92016-11-22 13:47:04 -050018 cflags = [ "/wd4201" ] # nameless struct/union
Alexis Hetu03b67af2016-08-31 17:25:40 -040019
20 if (is_clang) {
21 cflags += [
Alexis Hetu03b67af2016-08-31 17:25:40 -040022 "-Wno-string-conversion",
23 "-Wno-sign-compare",
24 ]
25 }
26 } else {
Alexis Hetu91f10e32016-06-07 19:53:42 -040027 cflags = [
28 "-DLOG_TAG=\"swiftshader_main\"",
29 "-msse2",
30 ]
Alexis Hetu91f10e32016-06-07 19:53:42 -040031 }
32}
33
34source_set("swiftshader_main") {
Alexis Hetud6d10f92016-11-22 13:47:04 -050035 deps = [
36 "../Common:swiftshader_common",
37 ]
Alexis Hetu91f10e32016-06-07 19:53:42 -040038
39 sources = [
40 "Config.cpp",
41 "FrameBuffer.cpp",
42 "SwiftConfig.cpp",
43 ]
44
Alexis Hetu8be41102016-09-12 17:45:55 -040045 if (is_linux) {
Alexis Hetu91f10e32016-06-07 19:53:42 -040046 sources += [
Alexis Hetu91f10e32016-06-07 19:53:42 -040047 "FrameBufferX11.cpp",
Alexis Hetud6d10f92016-11-22 13:47:04 -050048 "libX11.cpp",
Alexis Hetu91f10e32016-06-07 19:53:42 -040049 ]
Alexis Hetu8be41102016-09-12 17:45:55 -040050 } else if (is_mac) {
51 sources += [ "FrameBufferOSX.mm" ]
52 } else if (is_win) {
Alexis Hetu91f10e32016-06-07 19:53:42 -040053 sources += [
54 "FrameBufferDD.cpp",
55 "FrameBufferGDI.cpp",
56 "FrameBufferWin.cpp",
57 ]
58 }
59
Alexis Hetu8be41102016-09-12 17:45:55 -040060 if (is_win) {
61 configs -= [ "//build/config/win:unicode" ]
Alexis Hetud6d10f92016-11-22 13:47:04 -050062 libs = [ "dxguid.lib" ] # For FrameBufferDD
Alexis Hetu46c1b912016-06-23 11:06:46 -040063 }
Alexis Hetud6d10f92016-11-22 13:47:04 -050064
Alexis Hetu8be41102016-09-12 17:45:55 -040065 configs += [ ":swiftshader_main_private_config" ]
Alexis Hetu91f10e32016-06-07 19:53:42 -040066
67 include_dirs = [
68 "..",
69 "../Common",
70 ]
Alexis Hetu8be41102016-09-12 17:45:55 -040071
72 if (is_mac) {
73 include_dirs += [ "../../include" ]
74 libs = [
75 "Quartz.framework",
Alexis Hetud6d10f92016-11-22 13:47:04 -050076 "Cocoa.framework",
Alexis Hetu8be41102016-09-12 17:45:55 -040077 ]
78 }
Alexis Hetud6d10f92016-11-22 13:47:04 -050079}