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/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # set tmpdir to some mixed case path, suitable for native tools
21 gb_TMPDIR
:=$(if
$(TMPDIR
),$(shell cygpath
-m
$(TMPDIR
)),$(shell cygpath
-m
/tmp
))
23 # please make generic Windows modifications to windows.mk
24 include $(GBUILDDIR
)/platform
/windows.mk
34 # use CC/CXX if they are nondefaults
35 ifneq ($(origin CC
),default
)
39 ifneq ($(origin CXX
),default
)
44 -D_CRT_NON_CONFORMING_SWPRINTFS \
45 -D_CRT_NONSTDC_NO_DEPRECATE \
46 -D_CRT_SECURE_NO_DEPRECATE \
49 -DCPPU_ENV
=$(gb_CPPU_ENV
) \
51 $(if
$(findstring 110_70
,$(VCVER
)_
$(WINDOWS_SDK_VERSION
)),-D_USING_V110_SDK71_
) \
53 ifeq ($(CPUNAME
),INTEL
)
55 -DBOOST_MEM_FN_ENABLE_CDECL \
66 gb_AFLAGS
:= $(AFLAGS
)
68 # Do we really need to disable to many warnings? It seems to me that
69 # many of these warnings are for custructs that we have been actively
70 # cleaning away from the code, to avoid warnings when building with
71 # gcc or Clang and -Wall -Werror.
73 # C4127: conditional expression is constant
75 # C4189: 'identifier' : local variable is initialized but not referenced
77 # C4242: 'identifier' : conversion from 'type1' to 'type2', possible
80 # C4244: nonstandard extension used : formal parameter 'identifier'
81 # was previously defined as a type
83 # C4245: 'conversion' : conversion from 'type1' to 'type2',
84 # signed/unsigned mismatch
86 # C4250: 'class1' : inherits 'class2::member' via dominance
88 # C4251: 'identifier' : class 'type' needs to have dll-interface to be
89 # used by clients of class 'type2'
91 # C4275: non-DLL-interface classkey 'identifier' used as base for
92 # DLL-interface classkey 'identifier'
94 # C4290: C++ exception specification ignored except to indicate a
95 # function is not __declspec(nothrow)
97 # C4351: new behavior: elements of array 'array' will be default
100 # C4355: 'this' : used in base member initializer list
102 # C4373: '%$S': virtual function overrides '%$pS', previous versions
103 # of the compiler did not override when parameters only differed by
104 # const/volatile qualifiers.
106 # C4505: 'function' : unreferenced local function has been removed
108 # C4512: 'class' : assignment operator could not be generated
110 # C4611: interaction between 'function' and C++ object destruction is
113 # C4626: 'derived class' : assignment operator could not be generated
114 # because a base class assignment operator is inaccessible
116 # C4706: assignment within conditional expression
118 # C4800: 'type' : forcing value to bool 'true' or 'false' (performance
121 # C4996: 'function': was declared deprecated
122 # Also generated for C++ library functions that "may be unsafe"
129 $(if
$(MSVC_USE_DEBUG_RUNTIME
),-MDd
,-MD
) \
144 -Zc
:forScope
,wchar_t- \
153 $(if
$(MSVC_USE_DEBUG_RUNTIME
),-MDd
,-MD
) \
172 -Zc
:forScope
,wchar_t- \
175 ifneq ($(MSVC_USE_DEBUG_RUNTIME
),)
181 # New warning(s) in Visual Studio 2010, let's try disabling these only
182 # for that specific compiler version, in case a later one will not
183 # need them disabled.
190 # C4005: 'identifier' : macro redefinition
202 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS
),TRUE
)
203 gb_CFLAGS_WERROR
:= -WX
204 gb_CXXFLAGS_WERROR
:= -WX
207 ifneq ($(MERGELIBS
),)
208 gb_CFLAGS
+= -DLIBO_MERGELIBS
209 gb_CXXFLAGS
+= -DLIBO_MERGELIBS
212 gb_LinkTarget_EXCEPTIONFLAGS
:= \
216 gb_LinkTarget_NOEXCEPTIONFLAGS
:= \
219 gb_PrecompiledHeader_EXCEPTIONFLAGS
:= $(gb_LinkTarget_EXCEPTIONFLAGS
)
221 gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS
:= $(gb_LinkTarget_NOEXCEPTIONFLAGS
)
223 gb_LinkTarget_LDFLAGS
:= \
224 $(if
$(findstring s
,$(filter-out --%,$(MAKEFLAGS
))),-nologo
,) \
225 $(patsubst %,-LIBPATH
:%,$(filter-out .
,$(subst ;, ,$(subst \
,/,$(ILIB
))))) \
227 gb_DEBUG_CFLAGS
:= -Zi
229 # this does not use CFLAGS so it is not overridable
230 ifneq ($(ENABLE_CRASHDUMP
),)
235 ifeq ($(gb_SYMBOL
),$(true
))
236 gb_CFLAGS
+=$(gb_DEBUG_CFLAGS
)
237 gb_CXXFLAGS
+=$(gb_DEBUG_CFLAGS
)
240 gb_COMPILEROPTFLAGS
:= -Ob1
-Oxs
-Oy-
241 gb_COMPILERNOOPTFLAGS
:= -Od
243 ifeq ($(gb_FULLDEPS
),$(true
))
244 gb_COMPILERDEPFLAGS
:= -showIncludes
245 define gb_create_deps
246 |
$(GBUILDDIR
)/platform
/filter-showIncludes.awk
-vdepfile
=$(1) -vobjectfile
=$(2) -vsourcefile
=$(3); exit
$${PIPESTATUS
[0]}
249 gb_COMPILERDEPFLAGS
:=
250 define gb_create_deps
254 gb_LTOFLAGS
:= $(if
$(filter TRUE
,$(ENABLE_LTO
)),-GL
)
258 gb_Helper_OUTDIRLIBDIR
:= $(OUTDIR
)/bin
259 gb_Helper_OUTDIR_FOR_BUILDLIBDIR
:= $(OUTDIR_FOR_BUILD
)/bin
261 # need windows path with backslashes here
262 gb_Helper_set_ld_path
:= PATH
="$(shell cygpath -w $(OUTDIR)/bin)"
264 # vim: set noet sw=4: