forked from robin-raymond/zsLib
-
Notifications
You must be signed in to change notification settings - Fork 4
/
BUILD.gn
123 lines (102 loc) · 2.53 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//third_party/idl/zsLib-eventing/zslib_eventing_tool.gni")
import("zslib_sources.gni")
if (is_android) {
import("//build/config/android/rules.gni")
import("//build/config/android/config.gni")
}
config("zslib_config") {
configs = []
if (is_win) {
configs += [ "//build/config/win:cpp17" ]
cflags_cc = [
"/WX-",
"/wd4068",
"/wd4290",
]
if (current_os != "winuwp")
{
cflags_cc += ["/EHsc"]
}
} else {
cflags_cc = [
"-std=c++11",
"-g",
"-Wall",
]
if (is_linux || is_android) {
cflags_cc += [
"-nostdinc++",
]
}
}
include_dirs = [
".",
"zsLib/extras",
]
if (is_android) {
if (current_cpu == "arm64") {
include_dirs += [ "$android_ndk_root/platforms/android-21/arch-arm64/usr/include", ]
} else {
include_dirs += [ "$android_ndk_root/platforms/android-16/arch-arm/usr/include", ]
}
}
}
static_library("zslib") {
configs += [ ":zslib_config" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs -= [ "//build/config/compiler:no_rtti" ]
sources = zslib_sources
if (!is_win) {
configs -= [ "//build/config/gcc:no_exceptions" ]
}
defines = [
"_LIB",
]
if (is_android){
defines += [
"ANDROID",
"HAVE_INTTYPES_H",
"HAVE_UNISTD_H",
"HAVE_ERRNO_H",
"HAVE_NETINET_IN_H",
"HAVE_SYS_IOCTL_H",
"HAVE_SYS_MMAN_H",
"HAVE_SYS_MOUNT_H",
"HAVE_SYS_PRCTL_H",
"HAVE_SYS_RESOURCE_H",
"HAVE_SYS_SELECT_H",
"HAVE_SYS_STAT_H",
"HAVE_SYS_TYPES_H",
"HAVE_STDLIB_H",
"HAVE_STRDUP",
"HAVE_MMAP",
"HAVE_UTIME_H",
"HAVE_GETPAGESIZE",
"HAVE_LSEEK64",
"HAVE_LSEEK64_PROTOTYPE",
"HAVE_EXT2_IOCTLS",
"HAVE_LINUX_FD_H",
"HAVE_TYPE_SSIZE_T",
"HAVE_SYS_TIME_H",
"HAVE_SYS_PARAM_H",
"HAVE_SYSCONF",
]
}
deps = [
":zslib_events",
]
if (is_linux) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
}
compile_single_event_macro("zslib_events") {
sources = [
"zsLib/cpp/zsLib.events.json",
]
idlOutputPath = "../Internal"
idlAlreadyCompletedFlag = "zsLib_eventsCompiled.flg"
}