tdf#117994 doc: Revert "tdf#99474 close direct char fmt at end of para"
[LibreOffice.git] / bridges / Library_cpp_uno.mk
blob85dd3ec8daf096ada5b3dc53b8dc2c432227a11b
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 ($(OS),SOLARIS)
81 bridges_SELECTED_BRIDGE := gcc3_solaris_intel
82 bridge_exception_objects := cpp2uno except uno2cpp
83 bridge_noncallexception_objects := callvirtualmethod
84 else ifeq ($(COM),MSC)
85 bridges_SELECTED_BRIDGE := msvc_win32_intel
86 bridge_exception_objects := cpp2uno uno2cpp
87 bridge_noopt_objects := except
88 else ifeq ($(OS),EMSCRIPTEN)
89 bridges_SELECTED_BRIDGE := gcc3_wasm
90 bridge_noopt_objects := cpp2uno except uno2cpp
91 endif
93 else ifeq ($(CPUNAME),M68K)
95 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
96 bridges_SELECTED_BRIDGE := gcc3_linux_m68k
97 bridge_noopt_objects := cpp2uno except uno2cpp
98 endif
100 else ifeq ($(CPUNAME),MIPS)
102 ifneq ($(filter LINUX,$(OS)),)
103 bridges_SELECTED_BRIDGE := gcc3_linux_mips
104 bridge_noopt_objects := cpp2uno uno2cpp
105 bridge_exception_objects := except
106 endif
108 else ifeq ($(CPUNAME),MIPS64)
110 ifneq ($(filter LINUX,$(OS)),)
111 bridges_SELECTED_BRIDGE := gcc3_linux_mips64
112 bridge_asm_objects := call
113 bridge_noopt_objects := cpp2uno uno2cpp
114 bridge_exception_objects := except
115 endif
117 else ifeq ($(CPUNAME),LOONGARCH64)
119 ifneq ($(filter LINUX,$(OS)),)
120 bridges_SELECTED_BRIDGE := gcc3_linux_loongarch64
121 bridge_asm_objects := call
122 bridge_noopt_objects := cpp2uno uno2cpp
123 bridge_exception_objects := except
124 endif
126 else ifeq ($(CPUNAME),POWERPC)
128 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
129 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc
130 bridge_noopt_objects := uno2cpp
131 bridge_exception_objects := cpp2uno except
132 else ifeq ($(OS),AIX)
133 bridges_SELECTED_BRIDGE := gcc3_aix_powerpc
134 bridge_exception_objects := except
135 bridge_cxx_objects := cpp2uno uno2cpp
136 endif
138 else ifeq ($(CPUNAME),POWERPC64)
140 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
141 bridges_SELECTED_BRIDGE := gcc3_linux_powerpc64
142 bridge_noopt_objects := cpp2uno uno2cpp
143 bridge_exception_objects := except
144 endif
146 else ifeq ($(CPUNAME),S390)
148 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
149 bridges_SELECTED_BRIDGE := gcc3_linux_s390
150 bridge_exception_objects := cpp2uno except uno2cpp
151 endif
153 else ifeq ($(CPUNAME),S390X)
155 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
156 bridges_SELECTED_BRIDGE := gcc3_linux_s390x
157 bridge_exception_objects := cpp2uno except uno2cpp
158 endif
160 else ifeq ($(CPUNAME),SPARC)
162 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),)
163 bridges_SELECTED_BRIDGE := gcc3_linux_sparc
164 bridge_asm_objects := call
165 bridge_noopt_objects := except
166 bridge_exception_objects := cpp2uno uno2cpp
167 else ifeq ($(OS),SOLARIS)
168 bridges_SELECTED_BRIDGE := gcc3_solaris_sparc
169 bridge_noopt_objects := cpp2uno uno2cpp
170 bridge_exception_objects := except
171 endif
173 else ifeq ($(OS)-$(CPUNAME),LINUX-SPARC64)
175 bridges_SELECTED_BRIDGE := gcc3_linux_sparc64
176 bridge_asm_objects := call
177 bridge_noopt_objects := cpp2uno uno2cpp
178 bridge_exception_objects := except
180 else ifeq ($(CPUNAME),X86_64)
182 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU,$(OS)),)
183 bridges_SELECTED_BRIDGE := gcc3_linux_x86-64
184 bridge_asm_objects := call
185 bridge_noncallexception_noopt_objects := callvirtualmethod
186 bridge_exception_objects := abi cpp2uno except rtti uno2cpp
187 else ifneq ($(filter MACOSX iOS,$(OS)),)
188 bridges_SELECTED_BRIDGE := gcc3_macosx_x86-64
189 bridge_exception_objects := abi call cpp2uno except uno2cpp
190 bridge_noncallexception_noopt_objects := callvirtualmethod
191 else ifeq ($(COM),MSC)
192 bridges_SELECTED_BRIDGE := msvc_win32_x86-64
193 bridge_exception_objects := cpp2uno uno2cpp
194 bridge_noopt_objects := except
195 bridge_asm_objects := call
196 endif
198 endif
200 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
201 udkapi \
204 ifeq ($(OS),MACOSX)
205 ifeq ($(CPUNAME),AARCH64)
206 $(eval $(call gb_Library_use_internal_comprehensive_api,$(CPPU_ENV)_uno,\
207 offapi \
209 endif
210 endif
212 $(eval $(call gb_Library_set_include,$(CPPU_ENV)_uno,\
213 -I$(SRCDIR)/bridges/inc \
214 $$(INCLUDE) \
217 ifeq ($(HAVE_POSIX_FALLOCATE),YES)
218 $(eval $(call gb_Library_add_defs,$(CPPU_ENV)_uno,\
219 -DHAVE_POSIX_FALLOCATE \
221 endif
223 # In case someone enabled the non-standard -fomit-frame-pointer which does not
224 # work with the .cxx sources of this library.
225 # LTO causes crashes when enabled for this library
226 # In case the compiler supports AVX this code segfaults so specifically turn
227 # it off.
228 ifeq ($(COM),GCC)
229 $(eval $(call gb_Library_add_cxxflags,gcc3_uno,\
230 $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-I$(ANDROID_BINUTILS_PREBUILT_ROOT)/lib/gcc/arm-linux-androideabi/4.9.x/include) \
231 -fno-omit-frame-pointer \
232 -fno-strict-aliasing \
233 -fno-lto \
234 $(if $(filter TRUE,$(HAVE_GCC_AVX)),-mno-avx) \
237 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU,$(OS)),)
238 $(eval $(call gb_Library_add_libs,gcc3_uno,\
239 -ldl \
241 endif
242 endif
244 ifeq ($(COM),GCC)
245 ifneq ($(COM_IS_CLANG),TRUE)
246 bridges_NON_CALL_EXCEPTIONS_FLAGS := -fnon-call-exceptions
247 endif
248 endif
250 $(eval $(call gb_Library_use_libraries,$(CPPU_ENV)_uno,\
251 cppu \
252 sal \
255 $(foreach obj,$(bridge_exception_objects),\
256 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
257 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
259 $(foreach obj,$(bridge_noncallexception_objects),\
260 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
261 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
262 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
264 $(foreach obj,$(bridge_noopt_objects),\
265 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
266 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
267 , $(gb_COMPILERNOOPTFLAGS))) \
269 $(foreach obj,$(bridge_noncallexception_noopt_objects),\
270 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
271 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj) \
272 , $(gb_COMPILERNOOPTFLAGS) $(bridges_NON_CALL_EXCEPTIONS_FLAGS) )) \
274 $(foreach obj,$(bridge_cxx_objects),\
275 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
276 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
278 $(foreach obj,$(bridge_asm_objects),\
279 $(eval $(call gb_Library_add_asmobjects,$(CPPU_ENV)_uno,\
280 bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/$(obj))) \
283 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
284 bridges/source/cpp_uno/shared/bridge \
285 bridges/source/cpp_uno/shared/component \
286 bridges/source/cpp_uno/shared/types \
287 bridges/source/cpp_uno/shared/unointerfaceproxy \
288 bridges/source/cpp_uno/shared/vtablefactory \
289 bridges/source/cpp_uno/shared/vtables \
292 ifeq ($(COM),MSC)
293 $(eval $(call gb_Library_add_exception_objects,$(CPPU_ENV)_uno,\
294 bridges/source/cpp_uno/msvc_shared/cpp2uno \
295 bridges/source/cpp_uno/msvc_shared/except \
297 endif
299 $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\
300 bridges/source/cpp_uno/shared/cppinterfaceproxy \
301 , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
304 ifeq ($(DISABLE_DYNLOADING),TRUE)
305 $(eval $(call gb_Library_set_plugin_for_nodep,$(CPPU_ENV)_uno,cppu))
306 endif
308 # vim: set noet sw=4 ts=4: