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/c++/c++.gni")
16 import("//build/config/compiler/compiler.gni")
18 config("swiftshader_config") {
23 "/GS", # Detects some buffer overruns
25 "/EHs-c-", # Disable C++ exceptions
27 "/Gd", # Default calling convention
30 if (!use_custom_libcxx) {
31 # Disable EH usage in STL headers.
32 # libc++ uses a predefined macro to control whether to use exceptions, so
33 # defining this macro is unnecessary. Defining _HAS_EXCEPTIONS to 0 also
34 # breaks libc++ because it depends on MSVC headers that only provide
35 # certain declarations if _HAS_EXCEPTIONS is 1.
42 "_CRT_SECURE_NO_DEPRECATE",
45 "NO_SANITIZE_FUNCTION=",
49 defines += [ "ANGLE_DISABLE_TRACE" ]
55 "-fno-operator-names",
59 "__STDC_CONSTANT_MACROS",
60 "__STDC_LIMIT_MACROS",
61 "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))",
70 # All Release builds use function/data sections to make the shared libraries smaller
72 "-ffunction-sections",
74 "-fomit-frame-pointer",
79 "ANGLE_DISABLE_TRACE",
84 if (target_cpu == "x64") { # 64 bit version
91 } else { # 32 bit version
103 "-Wl,--hash-style=both",
107 # A bug in the gold linker prevents using ICF on 32-bit (crbug.com/729532)
108 if (use_gold && target_cpu == "x86") {
109 ldflags += [ "-Wl,--icf=none" ]
115 source_set("vertex_routine_fuzzer") {
117 "tests/fuzzers/VertexRoutineFuzzer.cpp"
121 "/wd4201", # nameless struct/union
122 "/wd4065", # switch statement contains 'default' but no 'case' labels
123 "/wd5030", # attribute is not recognized
130 "src/OpenGL/libGLESv2:swiftshader_libGLESv2_static",
134 group("swiftshader") {
136 "src/OpenGL/libGLESv2:swiftshader_libGLESv2",
137 "src/OpenGL/libEGL:swiftshader_libEGL",
141 group("swiftshader_tests") {
145 "tests/unittests:swiftshader_unittests",