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
))
14 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
15 bridges_SELECTED_BRIDGE
:= gcc3_linux_arm
16 bridge_noopt_objects
:= cpp2uno except uno2cpp
18 $(call gb_Library_get_linktarget_target
,gcc3_uno
) : \
19 $(gb_CustomTarget_workdir
)/bridges
/source
/cpp_uno
/gcc3_linux_arm
/armhelper.objectlist
20 $(call gb_Library_get_linktarget_target
,gcc3_uno
) : \
21 EXTRAOBJECTLISTS
+= $(gb_CustomTarget_workdir
)/bridges
/source
/cpp_uno
/gcc3_linux_arm
/armhelper.objectlist
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
) \
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
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
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
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
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_exception_objects
:= abi cpp2uno uno2cpp
87 $(eval
$(call gb_Library_add_generated_asmobjects
,$(CPPU_ENV
)_uno
, \
88 CustomTarget
/bridges
/gcc3_wasm
/generated-asm \
90 $(eval
$(call gb_Library_add_generated_exception_objects
,$(CPPU_ENV
)_uno
, \
91 CustomTarget
/bridges
/gcc3_wasm
/generated-cxx \
93 $(eval
$(call gb_Library_use_static_libraries
,$(CPPU_ENV
)_uno
, \
98 else ifeq ($(CPUNAME
),M68K
)
100 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
101 bridges_SELECTED_BRIDGE
:= gcc3_linux_m68k
102 bridge_noopt_objects
:= cpp2uno except uno2cpp
105 else ifeq ($(CPUNAME
),MIPS
)
107 ifneq ($(filter LINUX
,$(OS
)),)
108 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips
109 bridge_noopt_objects
:= cpp2uno uno2cpp
110 bridge_exception_objects
:= except
113 else ifeq ($(CPUNAME
),MIPS64
)
115 ifneq ($(filter LINUX
,$(OS
)),)
116 bridges_SELECTED_BRIDGE
:= gcc3_linux_mips64
117 bridge_asm_objects
:= call
118 bridge_noopt_objects
:= cpp2uno uno2cpp
119 bridge_exception_objects
:= except
122 else ifeq ($(CPUNAME
),LOONGARCH64
)
124 ifneq ($(filter LINUX
,$(OS
)),)
125 bridges_SELECTED_BRIDGE
:= gcc3_linux_loongarch64
126 bridge_asm_objects
:= call
127 bridge_noopt_objects
:= abi cpp2uno uno2cpp
128 bridge_exception_objects
:= except
131 else ifeq ($(CPUNAME
),RISCV64
)
133 ifneq ($(filter LINUX
,$(OS
)),)
134 bridges_SELECTED_BRIDGE
:= gcc3_linux_riscv64
135 bridge_asm_objects
:= call
136 bridge_noopt_objects
:= abi cpp2uno uno2cpp
137 bridge_exception_objects
:= except
140 else ifeq ($(CPUNAME
),POWERPC
)
142 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
143 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc
144 bridge_noopt_objects
:= uno2cpp
145 bridge_exception_objects
:= cpp2uno except
148 else ifeq ($(CPUNAME
),POWERPC64
)
150 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
151 bridges_SELECTED_BRIDGE
:= gcc3_linux_powerpc64
152 bridge_noopt_objects
:= cpp2uno uno2cpp
153 bridge_exception_objects
:= except
156 else ifeq ($(CPUNAME
),S390X
)
158 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
159 bridges_SELECTED_BRIDGE
:= gcc3_linux_s390x
160 bridge_exception_objects
:= cpp2uno except uno2cpp
163 else ifeq ($(CPUNAME
),SPARC
)
165 ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD
,$(OS
)),)
166 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc
167 bridge_asm_objects
:= call
168 bridge_noopt_objects
:= except
169 bridge_exception_objects
:= cpp2uno uno2cpp
172 else ifeq ($(OS
)-$(CPUNAME
),LINUX-SPARC64
)
174 bridges_SELECTED_BRIDGE
:= gcc3_linux_sparc64
175 bridge_asm_objects
:= call
176 bridge_noopt_objects
:= cpp2uno uno2cpp
177 bridge_exception_objects
:= except
179 else ifeq ($(CPUNAME
),X86_64
)
181 ifneq ($(filter ANDROID DRAGONFLY FREEBSD LINUX NETBSD OPENBSD HAIKU
,$(OS
)),)
182 bridges_SELECTED_BRIDGE
:= gcc3_linux_x86-64
183 bridge_asm_objects
:= call
184 bridge_noncallexception_noopt_objects
:= callvirtualmethod
185 bridge_exception_objects
:= abi cpp2uno except rtti uno2cpp
186 else ifneq ($(filter MACOSX iOS
,$(OS
)),)
187 bridges_SELECTED_BRIDGE
:= gcc3_macosx_x86-64
188 bridge_exception_objects
:= abi call cpp2uno except uno2cpp
189 bridge_noncallexception_noopt_objects
:= callvirtualmethod
190 else ifeq ($(COM
),MSC
)
191 bridges_SELECTED_BRIDGE
:= msvc_win32_x86-64
192 bridge_exception_objects
:= cpp2uno uno2cpp
193 bridge_noopt_objects
:= except
194 bridge_asm_objects
:= call
199 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(CPPU_ENV
)_uno
,\
204 ifeq ($(CPUNAME
),AARCH64
)
205 $(eval
$(call gb_Library_use_internal_comprehensive_api
,$(CPPU_ENV
)_uno
,\
211 $(eval
$(call gb_Library_set_include
,$(CPPU_ENV
)_uno
,\
212 -I
$(SRCDIR
)/bridges
/inc \
216 ifeq ($(HAVE_POSIX_FALLOCATE
),YES
)
217 $(eval
$(call gb_Library_add_defs
,$(CPPU_ENV
)_uno
,\
218 -DHAVE_POSIX_FALLOCATE \
222 # In case someone enabled the non-standard -fomit-frame-pointer which does not
223 # work with the .cxx sources of this library.
224 # LTO causes crashes when enabled for this library
225 # In case the compiler supports AVX this code segfaults so specifically turn
228 $(eval
$(call gb_Library_add_cxxflags
,gcc3_uno
,\
229 -fno-omit-frame-pointer \
230 -fno-strict-aliasing \
232 $(if
$(filter TRUE
,$(HAVE_GCC_AVX
)),-mno-avx
) \
235 ifeq ($(filter ANDROID WNT DRAGONFLY FREEBSD NETBSD OPENBSD MACOSX iOS HAIKU
,$(OS
)),)
236 $(eval
$(call gb_Library_add_libs
,gcc3_uno
,\
243 ifneq ($(COM_IS_CLANG
),TRUE
)
244 bridges_NON_CALL_EXCEPTIONS_FLAGS
:= -fnon-call-exceptions
248 $(eval
$(call gb_Library_use_libraries
,$(CPPU_ENV
)_uno
,\
253 $(foreach obj
,$(bridge_exception_objects
),\
254 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
255 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
257 $(foreach obj
,$(bridge_noncallexception_objects
),\
258 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
259 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
260 , $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
262 $(foreach obj
,$(bridge_noopt_objects
),\
263 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
264 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
265 , $(gb_COMPILERNOOPTFLAGS
))) \
267 $(foreach obj
,$(bridge_noncallexception_noopt_objects
),\
268 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
269 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
) \
270 , $(gb_COMPILERNOOPTFLAGS
) $(bridges_NON_CALL_EXCEPTIONS_FLAGS
) )) \
272 $(foreach obj
,$(bridge_cxx_objects
),\
273 $(eval
$(call gb_Library_add_cxxobjects
,$(CPPU_ENV
)_uno
,\
274 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
276 $(foreach obj
,$(bridge_asm_objects
),\
277 $(eval
$(call gb_Library_add_asmobjects
,$(CPPU_ENV
)_uno
,\
278 bridges
/source
/cpp_uno
/$(bridges_SELECTED_BRIDGE
)/$(obj
))) \
281 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
282 bridges
/source
/cpp_uno
/shared
/bridge \
283 bridges
/source
/cpp_uno
/shared
/component \
284 bridges
/source
/cpp_uno
/shared
/types \
285 bridges
/source
/cpp_uno
/shared
/unointerfaceproxy \
286 bridges
/source
/cpp_uno
/shared
/vtablefactory \
287 bridges
/source
/cpp_uno
/shared
/vtables \
291 $(eval
$(call gb_Library_add_exception_objects
,$(CPPU_ENV
)_uno
,\
292 bridges
/source
/cpp_uno
/msvc_shared
/cpp2uno \
293 bridges
/source
/cpp_uno
/msvc_shared
/except \
297 $(eval
$(call gb_Library_add_cxxobjects
,$(CPPU_ENV
)_uno
,\
298 bridges
/source
/cpp_uno
/shared
/cppinterfaceproxy \
299 , $(gb_COMPILERNOOPTFLAGS
) $(gb_LinkTarget_EXCEPTIONFLAGS
) \
302 ifeq ($(DISABLE_DYNLOADING
),TRUE
)
303 $(eval
$(call gb_Library_set_plugin_for_nodep
,$(CPPU_ENV
)_uno
,cppu
))
306 # vim: set noet sw=4 ts=4: