-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathcxx.mk
More file actions
124 lines (109 loc) · 3.53 KB
/
Copy pathcxx.mk
File metadata and controls
124 lines (109 loc) · 3.53 KB
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
124
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
# C++ library definitions
#
# To define a C++ library glean_cpp_lib, add
#
# CXX_SOURCES_glean_cpp_lib = ...
#
# Additionaly, we support:
#
# CXX_FLAGS_glean_cpp_lib = ... - sets additional C++ flags for the library
CXX_SOURCES_glean_cpp_rts = \
glean/rts/binary.cpp \
glean/rts/benchmarking/factblock.cpp \
glean/rts/benchmarking/ffi.cpp \
glean/rts/bytecode/subroutine.cpp \
glean/rts/cache.cpp \
glean/rts/define.cpp \
glean/rts/error.cpp \
glean/rts/fact.cpp \
glean/rts/factset.cpp \
glean/rts/ffi.cpp \
glean/rts/inventory.cpp \
glean/rts/json.cpp \
glean/rts/lookup.cpp \
glean/rts/nat.cpp \
glean/rts/ownership.cpp \
glean/rts/ownership/derived.cpp \
glean/rts/ownership/setu64.cpp \
glean/rts/ownership/slice.cpp \
glean/rts/ownership/uset.cpp \
glean/rts/prim.cpp \
glean/rts/query.cpp \
glean/rts/sanity.cpp \
glean/rts/set.cpp \
glean/rts/stats.cpp \
glean/rts/string.cpp \
glean/rts/substitution.cpp \
glean/rts/thrift.cpp \
glean/rts/timer.cpp \
glean/rts/validate.cpp
CXX_FLAGS_glean_cpp_rts = -DOSS=1
CXX_SOURCES_glean_cpp_rocksdb_stats = \
glean/rocksdb/stats.cpp
CXX_SOURCES_glean_cpp_rocksdb = \
glean/rocksdb/container-impl.cpp \
glean/rocksdb/database-impl.cpp \
glean/rocksdb/ownership.cpp \
glean/rocksdb/ffi.cpp \
glean/rocksdb/rocksdb.cpp
# -fno-rtti is needed because RocksDB is compiled with it, and we
# get linker errors for references to missing typeinfo symbols if
# we don't.
CXX_FLAGS_glean_cpp_rocksdb = -fno-rtti -DOSS=1
CXX_SOURCES_glean_cpp_client = \
glean/cpp/filewriter.cpp \
glean/cpp/glean.cpp \
glean/interprocess/cpp/worklist.cpp \
glean/interprocess/cpp/counters.cpp
CXX_FLAGS_glean_cpp_client = -DOSS=1
CXX_SOURCES_glean_client_hs = \
glean/client/hs/cpp/write.cpp
CXX_GTEST_SOURCES_BinaryTest = \
glean/rts/tests/BinaryTest.cpp
CXX_GTEST_LIBS_BinaryTest = glean_cpp_rts
CXX_GTEST_FLAGS_BinaryTest = -DOSS=1
# End of C++ library definitions
# Determine all C++ libraries
CXX_LIBRARIES = $(subst CXX_SOURCES_,,$(filter CXX_SOURCES_%, $(.VARIABLES)))
CXX_GTESTS = $(subst CXX_GTEST_SOURCES_,,$(filter CXX_GTEST_SOURCES_%, $(.VARIABLES)))
.PHONY: cxx-libraries
cxx-libraries:
@:
# Include the right settings
#
# The included makefile is supposed to add dependencies to cxx-libraries as
# necessary and also to define a variable CXX_DEFS_M4 whose value is a series
# of m4 defines for the following macros:
#
# CXX_EXTRA_SOURCE_FILES - extra-source-files: ...
# Additional files to track for Cabal (typically .a files)
#
# CXX_EXTRA_LIB_DIRS - extra-lib-dirs: ...
# Additional library directories, MUST be absolute (Cabal doesn't support
# relative ones)
#
# CXX_LIB_xxx
# Dependencies for library xxx - either cxx-sources and cxx-options (if
# compiled via Cabal) or extra-libraries (if compiled via make)
#
ifeq ($(CXX_MODE),make)
include mk/cxx-make.mk
else
include mk/cxx-cabal.mk
endif
# Generate defs.m4 which is used by glean.cabal.in
.PHONY: force
# Make sure we keep the timestamp if the contents hasn't changed
$(CXX_DIR)/defs.m4: force | $(CXX_DIR)
$(file >$@.new,$(CXX_DEFS_M4))
@cmp -s $@ $@.new || mv $@.new $@
@rm -rf $@.new
# Has to be a separate target because we can have shell commands before
# $(file) in the rule above.
$(CXX_DIR):
@mkdir -p $@