# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the following license notice: # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed # with this work for additional information regarding copyright # ownership. The ASF licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . #
# please make generic Windows modifications to windows.mk include $(GBUILDDIR)/platform/windows.mk
# use CC/CXX if they are nondefaults ifneq ($(origin CC),default)
gb_CC := $(CC)
gb_GCCP := $(CC) endif ifneq ($(origin CXX),default)
gb_CXX := $(CXX) endif
# _SILENCE_CXX23_DENORM_DEPRECATION_WARNING is needed at least with Boost 1.82.0 using # std::numeric_limits::has_denorm in # workdir/UnpackedTarball/boost/boost/spirit/home/classic/core/primitives/impl/numerics.ipp, in turn # included from boost/spirit/include/classic_core.hpp as included from various of our code files:
# _SCL_SECURE_NO_WARNINGS avoids deprecation warnings for STL algorithms # like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled)
# Do we really need to disable this many warnings? It seems to me that # many of these warnings are for constructs that we have been actively # cleaning away from the code, to avoid warnings when building with # gcc or Clang and -Wall -Werror.
# C4127: conditional expression is constant
# C4201: nonstandard extension used : nameless struct/union
# C4244: 'argument' : conversion from 'type1' to 'type2', possible loss of data
# C4250: 'class1' : inherits 'class2::member' via dominance
# C4251: 'identifier' : class 'type' needs to have dll-interface to be # used by clients of class 'type2'
# C4267: conversion from 'size_t' to 'type', possible loss of data
# C4275: non-DLL-interface classkey 'identifier' used as base for # DLL-interface classkey 'identifier'
# C4505: 'function' : unreferenced local function has been removed
# C4611: interaction between 'function' and C++ object destruction is # non-portable
# C4702: unreachable code
# C4706: assignment within conditional expression
# build-time penalty is too high for ci use/disable when JENKINS_HOME is set
MSVC_ANALYZE_FLAGS := $(if $(ENABLE_MSVC_ANALYZE),-analyze:ruleset$(SRCDIR)/solenv/vs/LibreOffice.ruleset,)
# there does not seem to be a way to force C++03 with MSVC, nor with clang-cl against MSVC system # headers; the oldest version that MSVC supports is C++14, so use that as a rather imperfect # approximation:
gb_CXX03FLAGS := -std:c++14
# Prevent warning spamming # Happens because of the way we link our unit tests with our libraries. # LNK4049: locally defined symbol
gb_LinkTarget_LDFLAGS += \
/ignore:4217 /ignore:4049
# VS2019 produces a warning C4857, that it doesn't support -std:c++20; it can't # be suppressed by -wd4857, only by -Wv:18. The warning seems incorrect, because # using -std:c++17 produces errors about undeclared 'char8_t'. VS2022 doesn't # have the problem, so drop -Wv:18 when bumping baseline. # Similarly, at least VS2022 Preview 17.12.0 Preview 2.1 with --with-latest-c++ emits a "warning # C4857: C++/CLI mode does not support C++ versions newer than C++20; setting language to # /std:c++20" that cannot be disabled by adding -wd4857, so hardcode a -std:c++20 substitution in # that case:
gb_CXXCLRFLAGS := \
$(if $(COM_IS_CLANG), \
$(patsubst -std=%,-std:c++20 -Zc:__cplusplus,$(gb_CXXFLAGS)), \
$(if $(filter -std:c++latest,$(CXXFLAGS_CXX11)), \
$(patsubst -std:c++latest,-std:c++20,$(gb_CXXFLAGS)), \
$(gb_CXXFLAGS))) \
$(gb_LinkTarget_EXCEPTIONFLAGS) \
-AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
-EHa \
-clr \
$(if $(filter 16.0,$(VCVER)),-Wv:18) \
-Zc:twoPhase- \
# $(1): one directory pathname to append to the ld path define gb_Helper_extend_ld_path
$(gb_Helper_set_ld_path)':$(call gb_Helper_cyg_path,$(1))' endef
# common macros to build GPG related libraries # we explicitly have to replace cygwin with mingw32 for the host, but the build must stay cygwin, or cmd.exe processes will be spawned
gb_WIN_GPG_WINDRES_target := $(if $(filter INTEL,$(CPUNAME)),pe-i386,pe-x86-64)
gb_WIN_GPG_platform_switches := --build=$(BUILD_PLATFORM) --host=$(subst cygwin,mingw32,$(HOST_PLATFORM))
gb_WIN_GPG_cross_setup_exports = export REAL_BUILD_CC="$(filter-out -%,$(CC_FOR_BUILD))" REAL_BUILD_CC_FLAGS="$(filter -%,$(CC_FOR_BUILD))" \
&& export CC_FOR_BUILD="$(call gb_Executable_get_target_for_build,gcc-wrapper) --wrapper-env-prefix=REAL_BUILD_ $(SOLARINC) -L$(subst ;, -L,$(ILIB_FOR_BUILD))" \
&& export RC='windres -O COFF --target=$(gb_WIN_GPG_WINDRES_target) --preprocessor=$(call gb_Executable_get_target_for_build,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'
ifneq ($(gb_ENABLE_PCH),) # Enable use of .sum files for PCHs.
gb_COMPILER_SETUP += CCACHE_PCH_EXTSUM=1 endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.