update credits
[LibreOffice.git] / solenv / gbuild / platform / com_MSC_defs.mk
blob2056c259bae77e2691ab5649841699fd374b3007
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
26 gb_CC := cl
27 gb_CXX := cl
28 gb_LINK := link
29 gb_AWK := awk
30 gb_CLASSPATHSEP := ;
31 gb_RC := rc
32 gb_YACC := bison
34 # use CC/CXX if they are nondefaults
35 ifneq ($(origin CC),default)
36 gb_CC := $(CC)
37 gb_GCCP := $(CC)
38 endif
39 ifneq ($(origin CXX),default)
40 gb_CXX := $(CXX)
41 endif
43 gb_COMPILERDEFS := \
44 -D_CRT_NON_CONFORMING_SWPRINTFS \
45 -D_CRT_NONSTDC_NO_DEPRECATE \
46 -D_CRT_SECURE_NO_DEPRECATE \
47 -D_MT \
48 -D_DLL \
49 -DCPPU_ENV=$(gb_CPPU_ENV) \
50 -DM1500 \
51 $(if $(findstring 110_70,$(VCVER)_$(WINDOWS_SDK_VERSION)),-D_USING_V110_SDK71_) \
53 ifeq ($(CPUNAME),INTEL)
54 gb_COMPILERDEFS += \
55 -DBOOST_MEM_FN_ENABLE_CDECL \
57 endif
59 gb_RCDEFS := \
60 -DWINVER=0x0400 \
61 -DWIN32 \
63 gb_RCFLAGS := \
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
78 # loss of data
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
98 # initialized
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
111 # non-portable
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
119 # warning)
121 # C4996: 'function': was declared deprecated
122 # Also generated for C++ library functions that "may be unsafe"
124 gb_CFLAGS := \
125 -Gd \
126 -GR \
127 -Gs \
128 -GS \
129 $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \
130 -nologo \
131 -W4 \
132 -wd4127 \
133 -wd4189 \
134 -wd4242 \
135 -wd4244 \
136 -wd4245 \
137 -wd4251 \
138 -wd4355 \
139 -wd4505 \
140 -wd4512 \
141 -wd4626 \
142 -wd4706 \
143 -wd4800 \
144 -Zc:forScope,wchar_t- \
145 -Zm500 \
147 gb_CXXFLAGS := \
148 -Gd \
149 -GR \
150 -Gs \
151 -GS \
152 -Gy \
153 $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \
154 -nologo \
155 -W4 \
156 -wd4127 \
157 -wd4189 \
158 -wd4244 \
159 -wd4245 \
160 -wd4250 \
161 -wd4251 \
162 -wd4275 \
163 -wd4290 \
164 -wd4351 \
165 -wd4355 \
166 -wd4373 \
167 -wd4505 \
168 -wd4512 \
169 -wd4611 \
170 -wd4706 \
171 -wd4800 \
172 -Zc:forScope,wchar_t- \
173 -Zm500 \
175 ifneq ($(MSVC_USE_DEBUG_RUNTIME),)
176 gb_CXXFLAGS += \
177 -wd4996 \
179 endif
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.
184 ifeq ($(VCVER),100)
186 # (none currently)
188 endif
190 # C4005: 'identifier' : macro redefinition
192 gb_PCHWARNINGS = \
193 -we4650 \
194 -we4651 \
195 -we4652 \
196 -we4653 \
197 -we4005 \
199 gb_STDLIBS := \
200 advapi32.lib \
202 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
203 gb_CFLAGS_WERROR := -WX
204 gb_CXXFLAGS_WERROR := -WX
205 endif
207 ifneq ($(MERGELIBS),)
208 gb_CFLAGS += -DLIBO_MERGELIBS
209 gb_CXXFLAGS += -DLIBO_MERGELIBS
210 endif
212 gb_LinkTarget_EXCEPTIONFLAGS := \
213 -DEXCEPTIONS_ON \
214 -EHa \
216 gb_LinkTarget_NOEXCEPTIONFLAGS := \
217 -DEXCEPTIONS_OFF \
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),)
231 gb_CFLAGS+=-Zi
232 gb_CXXFLAGS+=-Zi
233 endif
235 ifeq ($(gb_SYMBOL),$(true))
236 gb_CFLAGS+=$(gb_DEBUG_CFLAGS)
237 gb_CXXFLAGS+=$(gb_DEBUG_CFLAGS)
238 endif
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]}
247 endef
248 else
249 gb_COMPILERDEPFLAGS :=
250 define gb_create_deps
251 endef
252 endif
254 gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
256 # Helper class
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: