Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / bridges / Library_cpp_uno.mk
blob7b10348e83b7f3c57a5cba3065c6eec2ec1e1eea
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_Library_Library,$(CPPU_ENV)_uno))
12 ifeq ($(CPUNAME),ARM)
14 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
15 bridges_SELECTED_BRIDGE := gcc3_linux_arm
16 bridge_noopt_objects := cpp2uno except uno2cpp
17 # HACK
18 $(call gb_Library_get_linktarget_target,gcc3_uno) : \
19 $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist
20 $(call gb_Library_get_linktarget_target,gcc3_uno) : \
21 EXTRAOBJECTLISTS += $(call gb_CustomTarget_get_workdir,bridges/source/cpp_uno/gcc3_linux_arm)/armhelper.objectlist
22 endif
24 else ifeq ($(CPUNAME),AARCH64)
26 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX MACOSX NETBSD OPENBSD,$(OS)),)
27 bridges_SELECTED_BRIDGE := gcc3_linux_aarch64
28 bridge_asm_objects := vtableslotcall
29 bridge_exception_objects := abi cpp2uno uno2cpp
31 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno, \
32 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/callvirtualfunction, \
33 $(if $(HAVE_GCC_STACK_CLASH_PROTECTION),-fno-stack-clash-protection) \
34 $(if $(COM_IS_CLANG),-fasynchronous-unwind-tables) \
37 else ifeq ($(OS),iOS)
38 bridges_SELECTED_BRIDGE := gcc3_ios
39 bridge_noopt_objects := cpp2uno except uno2cpp
40 bridge_asm_objects := ios64_helper
42 else ifeq ($(COM),MSC)
43 bridges_SELECTED_BRIDGE := msvc_win32_arm64
44 bridge_exception_objects := cpp2uno uno2cpp abi
45 bridge_noopt_objects := except
46 bridge_asm_objects := callvirtualfunction vtableslotcall
48 endif
50 else ifeq ($(CPUNAME),AXP)
52 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
53 bridges_SELECTED_BRIDGE := gcc3_linux_alpha
54 bridge_exception_objects := cpp2uno except uno2cpp
55 endif
57 else ifeq ($(CPUNAME),HPPA)
59 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
60 bridges_SELECTED_BRIDGE := gcc3_linux_hppa
61 bridge_noopt_objects := call cpp2uno except uno2cpp
62 endif
64 else ifeq ($(CPUNAME),IA64)
66 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
67 bridges_SELECTED_BRIDGE := gcc3_linux_ia64
68 bridge_asm_objects := call
69 bridge_exception_objects := except
70 bridge_noopt_objects := cpp2uno uno2cpp
71 endif
73 else ifeq ($(CPUNAME),INTEL)
75 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
76 bridges_SELECTED_BRIDGE := gcc3_linux_intel
77 bridge_asm_objects := call
78 bridge_exception_objects := cpp2uno except uno2cpp
79 bridge_noncallexception_objects := callvirtualmethod
80 else ifeq ($(COM),MSC)
81 bridges_SELECTED_BRIDGE := msvc_win32_intel
82 bridge_exception_objects := cpp2uno uno2cpp
83 bridge_noopt_objects := except
84 else ifeq ($(OS),EMSCRIPTEN)
85 bridges_SELECTED_BRIDGE := gcc3_wasm
86 bridge_noopt_objects := cpp2uno except uno2cpp
87 endif
89 else ifeq ($(CPUNAME),M68K)
91 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
92 bridges_SELECTED_BRIDGE := gcc3_linux_m68k
93 bridge_noopt_objects := cpp2uno except uno2cpp
94 endif
96 else ifeq ($(CPUNAME),MIPS)
98 ifneq ($(filter LINUX,$(OS)),)
99 bridges_SELECTED_BRIDGE := gcc3_linux_mips
100 bridge_noopt_objects := cpp2uno uno2cpp
101 bridge_exception_objects := except
102 endif
104 else ifeq ($(CPUNAME),MIPS64)
106 ifneq ($(filter LINUX,$(OS)),)
107 bridges_SELECTED_BRIDGE := gcc3_linux_mips64
108 bridge_asm_objects := call
109 bridge_noopt_objects := cpp2uno uno2cpp
110 bridge_exception_objects := except
111 endif
113 else ifeq ($(CPUNAME),LOONGARCH64)
115 ifneq ($(filter LINUX,$(OS)),)
116 bridges_SELECTED_BRIDGE := gcc3_linux_loongarch64
117 bridge_asm_objects := call
118 bridge_noopt_objects := abi cpp2uno uno2cpp
119 bridge_exception_objects := except
120 endif
122 else ifeq ($(CPUNAME),RISCV64)
124 ifneq ($(filter LINUX,$(OS)),)
125 bridges_SELECTED_BRIDGE := gcc3_linux_riscv64
126 bridge_asm_objects := call
127 bridge_noopt_objects := abi cpp2uno uno2cpp
128 bridge_exception_objects := except
129 endif
131 else ifeq ($(CPUNAME),POWERPC)
133 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
134 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc
135 bridge_noopt_objects := uno2cpp
136 bridge_exception_objects := cpp2uno except
137 endif
139 else ifeq ($(CPUNAME),POWERPC64)
141 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
142 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc64
143 bridge_noopt_objects := cpp2uno uno2cpp
144 bridge_exception_objects := except
145 endif
147 else ifeq ($(CPUNAME),S390X)
149 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
150 bridges_SELECTED_BRIDGE := gcc3_linux_s390x
151 bridge_exception_objects := cpp2uno except uno2cpp
152 endif
154 else ifeq ($(CPUNAME),SPARC)
156 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
157 bridges_SELECTED_BRIDGE := gcc3_linux_sparc
158 bridge_asm_objects := call
159 bridge_noopt_objects := except
160 bridge_exception_objects := cpp2uno uno2cpp
161 endif
163 else ifeq ($(OS)-$(CPUNAME),LINUX-SPARC64)
165 bridges_SELECTED_BRIDGE := gcc3_linux_sparc64
166 bridge_asm_objects := call
167 bridge_noopt_objects := cpp2uno uno2cpp
168 bridge_exception_objects := except
170 else ifeq ($(CPUNAME),X86_64)
172 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
173 bridges_SELECTED_BRIDGE := gcc3_linux_x86-64
174 bridge_asm_objects := call
175 bridge_noncallexception_noopt_objects := callvirtualmethod
176 bridge_exception_objects := abi cpp2uno except rtti uno2cpp
177 else ifneq ($(filter MACOSX iOS,$(OS)),)
178 bridges_SELECTED_BRIDGE := gcc3_macosx_x86-64
179 bridge_exception_objects := abi call cpp2uno except uno2cpp
180 bridge_noncallexception_noopt_objects := callvirtualmethod
181 else ifeq ($(COM),MSC)
182 bridges_SELECTED_BRIDGE := msvc_win32_x86-64
183 bridge_exception_objects := cpp2uno uno2cpp
184 bridge_noopt_objects := except
185 bridge_asm_objects := call
186 endif
188 endif
190 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
191 udkapi \
194 ifeq ($(OS),MACOSX)
195 ifeq ($(CPUNAME),AARCH64)
196 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
197 offapi \
199 endif
200 endif
202 $(eval $(call gb_Library_set_include,$(CPPU_ENV)_uno,\
203 -I$(SRCDIR)/bridges/inc \
204 $$(INCLUDE) \
207 ifeq ($(HAVE_POSIX_FALLOCATE),YES)
208 $(eval $(call gb_Library_add_defs,$(CPPU_ENV)_uno,\
209 -DHAVE_POSIX_FALLOCATE \
211 endif
213 # In case someone enabled the non-standard -fomit-frame-pointer which does not
214 # work with the .cxx sources of this library.
215 # LTO causes crashes when enabled for this library
216 # In case the compiler supports AVX this code segfaults so specifically turn
217 # it off.
218 ifeq ($(COM),GCC)
219 $(eval $(call gb_Library_add_cxxflags,gcc3_uno,\
220 -fno-omit-frame-pointer \
221 -fno-strict-aliasing \
222 -fno-lto \
223 $(if $(filter TRUE,$(HAVE_GCC_AVX)),-mno-avx) \
226 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU,$(OS)),)
227 $(eval $(call gb_Library_add_libs,gcc3_uno,\
228 -ldl \
230 endif
231 endif
233 ifeq ($(COM),GCC)
234 ifneq ($(COM_IS_CLANG),TRUE)
235 bridges_NON_CALL_EXCEPTIONS_FLAGS := -fnon-call-exceptions
236 endif
237 endif
239 $(eval $(call gb_Library_use_libraries,$(CPPU_ENV)_uno,\
240 cppu \
241 sal \
244 $(foreach obj,$(bridge_exception_objects),\
245 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
246 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
248 $(foreach obj,$(bridge_noncallexception_objects),\
249 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
250 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
251 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
253 $(foreach obj,$(bridge_noopt_objects),\
254 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
255 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
256 , $(gb_COMPILERNOOPTFLAGS))) \
258 $(foreach obj,$(bridge_noncallexception_noopt_objects),\
259 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
260 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
261 , $(gb_COMPILERNOOPTFLAGS) $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
263 $(foreach obj,$(bridge_cxx_objects),\
264 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
265 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
267 $(foreach obj,$(bridge_asm_objects),\
268 $(eval $(call gb_Library_add_asmobjects,$(CPPU_ENV)_uno,\
269 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
272 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
273 bridges/source/cpp_uno/shared/bridge \
274 bridges/source/cpp_uno/shared/component \
275 bridges/source/cpp_uno/shared/types \
276 bridges/source/cpp_uno/shared/unointerfaceproxy \
277 bridges/source/cpp_uno/shared/vtablefactory \
278 bridges/source/cpp_uno/shared/vtables \
281 ifeq ($(COM),MSC)
282 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
283 bridges/source/cpp_uno/msvc_shared/cpp2uno \
284 bridges/source/cpp_uno/msvc_shared/except \
286 endif
288 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
289 bridges/source/cpp_uno/shared/cppinterfaceproxy \
290 , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
293 ifeq ($(DISABLE_DYNLOADING),TRUE)
294 $(eval $(call gb_Library_set_plugin_for_nodep,$(CPPU_ENV)_uno,cppu))
295 endif
297 # vim: set noet sw=4 ts=4: