1 # Copyright 2016 The SwiftShader Authors. All Rights Reserved.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 import("//build/config/compiler/compiler.gni")
17 config("swiftshader_config") {
22 "/GS", # Detects some buffer overruns
24 "/EHs-c-", # Disable C++ exceptions
26 "/Gd", # Default calling convention
30 "_HAS_EXCEPTIONS=0", # Disable EH usage in STL headers
31 "_CRT_SECURE_NO_DEPRECATE",
34 "NO_SANITIZE_FUNCTION=",
38 defines += [ "ANGLE_DISABLE_TRACE" ]
44 "-fno-operator-names",
48 "__STDC_CONSTANT_MACROS",
49 "__STDC_LIMIT_MACROS",
50 "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))",
59 # All Release builds use function/data sections to make the shared libraries smaller
61 "-ffunction-sections",
63 "-fomit-frame-pointer",
68 "ANGLE_DISABLE_TRACE",
73 if (target_cpu == "x64") { # 64 bit version
79 } else { # 32 bit version
89 "-Wl,--hash-style=both",
93 # A bug in the gold linker prevents using ICF on 32-bit (crbug.com/729532)
94 if (use_gold && target_cpu == "x86") {
95 ldflags += [ "-Wl,--icf=none" ]
101 source_set("vertex_routine_fuzzer") {
103 "tests/fuzzers/VertexRoutineFuzzer.cpp"
107 "/wd4201", # nameless struct/union
108 "/wd4065", # switch statement contains 'default' but no 'case' labels
109 "/wd5030", # attribute is not recognized
116 "src/OpenGL/libGLESv2:swiftshader_libGLESv2_static",
120 group("swiftshader") {
122 "src/OpenGL/libGLESv2:swiftshader_libGLESv2",
123 "src/OpenGL/libEGL:swiftshader_libEGL",
127 group("swiftshader_tests") {
131 "tests/unittests:swiftshader_unittests",