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
)
43 # _SCL_SECURE_NO_WARNINGS avoids deprecation warnings for STL algorithms
44 # like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled)
47 -DBOOST_ERROR_CODE_HEADER_ONLY \
48 -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \
49 -DBOOST_SYSTEM_NO_DEPRECATED \
50 -D_CRT_NON_CONFORMING_SWPRINTFS \
51 -D_CRT_NONSTDC_NO_DEPRECATE \
52 -D_CRT_SECURE_NO_DEPRECATE \
53 -D_SCL_SECURE_NO_WARNINGS \
56 -DCPPU_ENV
=$(gb_CPPU_ENV
) \
57 $(if
$(findstring 120_70
,$(VCVER
)_
$(WINDOWS_SDK_VERSION
)),-D_USING_V110_SDK71_
) \
59 ifeq ($(CPUNAME
),INTEL
)
61 -DBOOST_MEM_FN_ENABLE_CDECL \
71 gb_AFLAGS
:= $(AFLAGS
)
73 # Do we really need to disable this many warnings? It seems to me that
74 # many of these warnings are for constructs that we have been actively
75 # cleaning away from the code, to avoid warnings when building with
76 # gcc or Clang and -Wall -Werror.
78 # C4100: 'identifier' : unreferenced formal parameter
80 # C4127: conditional expression is constant
82 # C4189: 'identifier' : local variable is initialized but not referenced
84 # C4201: nonstandard extension used : nameless struct/union
86 # C4242: 'identifier' : conversion from 'type1' to 'type2', possible
89 # C4244: nonstandard extension used : formal parameter 'identifier'
90 # was previously defined as a type
92 # C4250: 'class1' : inherits 'class2::member' via dominance
94 # C4251: 'identifier' : class 'type' needs to have dll-interface to be
95 # used by clients of class 'type2'
97 # C4267: conversion from 'size_t' to 'type', possible loss of data
99 # C4275: non-DLL-interface classkey 'identifier' used as base for
100 # DLL-interface classkey 'identifier'
102 # C4290: C++ exception specification ignored except to indicate a
103 # function is not __declspec(nothrow)
105 # C4351: new behavior: elements of array 'array' will be default
108 # C4355: 'this' : used in base member initializer list
110 # C4373: '%$S': virtual function overrides '%$pS', previous versions
111 # of the compiler did not override when parameters only differed by
112 # const/volatile qualifiers.
113 # [translation: ancient compilers that don't actually support C++ do
116 # C4481: nonstandard extension used: override specifier 'override'
117 # (MSVC 2010 warns about this, even though it's C++11 keyword)
119 # C4505: 'function' : unreferenced local function has been removed
121 # C4512: 'class' : assignment operator could not be generated
123 # C4611: interaction between 'function' and C++ object destruction is
126 # C4626: 'derived class' : assignment operator could not be generated
127 # because a base class assignment operator is inaccessible
129 # C4702: unreachable code
131 # C4706: assignment within conditional expression
133 # C4800: 'type' : forcing value to bool 'true' or 'false' (performance
136 # C4913: user defined binary operator ',' exists but no overload could
137 # convert all operands, default built-in binary operator ',' used
144 $(if
$(MSVC_USE_DEBUG_RUNTIME
),-MDd
,-MD
) \
147 $(if
$(filter 0,$(gb_DEBUGLEVEL
)),-wd4100
) \
149 $(if
$(filter 0,$(gb_DEBUGLEVEL
)),-wd4189
) \
167 $(if
$(MSVC_USE_DEBUG_RUNTIME
),-MDd
,-MD
) \
170 $(if
$(filter 0,$(gb_DEBUGLEVEL
)),-wd4100
) \
172 $(if
$(filter 0,$(gb_DEBUGLEVEL
)),-wd4189
) \
192 ifneq ($(ENABLE_LTO
),)
194 # Sigh, but there are cases of C4702 when using link-time code
195 # generation and optimization where I couldn't get
196 # __pragma(warning(disable:4702)) to help. Especially, the
197 # ImplInheritanceHelper2() {} in <cppuhelper/implbase2.hxx>
198 # was reported as containing "unreachable code" when linking
199 # the dbaccess dbu library. Let's try globally disabling C4702.
201 # Might be fixed in VS2013 though?
202 # VCVER=110 for VS2012
204 ifneq ($(filter 110,$(VCVER
)),)
212 ifeq ($(CPUNAME
),X86_64
)
227 # rc.exe does not support -nologo in 6.1.6723.1 that is in the Windows SDK 6.0A
228 gb_RCFLAGS
+= -nologo
230 # C4005: 'identifier' : macro redefinition
242 gb_CFLAGS_WERROR
:= $(if
$(ENABLE_WERROR
),-WX
)
244 # there does not seem to be a way to force C++03 with MSVC
247 gb_LinkTarget_EXCEPTIONFLAGS
:= \
251 gb_PrecompiledHeader_EXCEPTIONFLAGS
:= $(gb_LinkTarget_EXCEPTIONFLAGS
)
253 gb_LinkTarget_LDFLAGS
:= \
254 $(if
$(findstring s
,$(filter-out --%,$(MAKEFLAGS
))),-nologo
,) \
255 $(patsubst %,-LIBPATH
:%,$(filter-out .
,$(subst ;, ,$(subst \
,/,$(ILIB
))))) \
257 gb_DEBUG_CFLAGS
:= -Zi
260 # Use -FS with VS2013: "Force Synchronous PDB Writes. Forces writes to
261 # the program database (PDB) file--created by /Zi or /ZI--to be
262 # serialized through MSPDBSRV.EXE"
266 # this does not use CFLAGS so it is not overridable
267 ifeq ($(gb_SYMBOL
),$(true
))
268 gb_CFLAGS
+=$(gb_DEBUG_CFLAGS
)
269 gb_CXXFLAGS
+=$(gb_DEBUG_CFLAGS
)
272 gb_COMPILEROPTFLAGS
:= -O2
-Oy-
273 gb_COMPILERNOOPTFLAGS
:= -Od
275 ifeq ($(gb_FULLDEPS
),$(true
))
276 gb_COMPILERDEPFLAGS
:= -showIncludes
277 define gb_create_deps
278 |
$(GBUILDDIR
)/platform
/filter-showIncludes.awk
-vdepfile
=$(1) -vobjectfile
=$(2) -vsourcefile
=$(3); exit
$${PIPESTATUS
[0]}
281 gb_COMPILERDEPFLAGS
:=
282 define gb_create_deps
286 gb_LTOFLAGS
:= $(if
$(filter TRUE
,$(ENABLE_LTO
)),-GL
)
290 ifeq ($(GNUMAKE_WIN_NATIVE
),TRUE
)
291 gb_Helper_set_ld_path
:= PATH
="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$$PATH"
293 define gb_Helper_prepend_ld_path
294 PATH
="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$(1);$$PATH"
298 gb_Helper_set_ld_path
:= PATH
="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$$PATH"
300 define gb_Helper_prepend_ld_path
301 PATH
="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$(1):$$PATH"
306 # vim: set noet sw=4: