diff options
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_class.mk | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 3df81343ee47..6715a2f5bee7 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -560,6 +560,8 @@ $(call gb_LinkTarget_get_target,$(1)) : LIBRARY_X64 := $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : PCH_NAME := $(call gb_LinkTarget_get_target,$(1)) : PCHOBJS := +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJEX := +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJNOEX := $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : PDBFILE := $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := @@ -876,10 +878,7 @@ $(call gb_CxxObject_get_target,$(2)) : \ ifeq ($(gb_FULLDEPS),$(true)) $(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS += $(2) $(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_CxxObject_get_dep_target,$(2)) -# It is not known by this time (or at least I don't know how to find out) which -# PCH variant will be used, so depend on both. $(call gb_CxxObject_get_target,$(2)) : $(call gb_PrecompiledHeader_get_timestamp,$(1)) -$(call gb_CxxObject_get_target,$(2)) : $(call gb_NoexPrecompiledHeader_get_timestamp,$(1)) endif endef @@ -1016,6 +1015,9 @@ endef define gb_LinkTarget_add_noexception_object $(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_NOEXCEPTIONFLAGS) $(call gb_LinkTarget__get_cxxflags,$(3))) +# noexception objects are rare, so generate matching .pch only when needed +$(call gb_CxxObject_get_target,$(2)) : $(call gb_NoexPrecompiledHeader_get_timestamp,$(1)) +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS = $$(PCHOBJEX) $$(PCHOBJNOEX) endef define gb_LinkTarget_add_exception_object @@ -1197,7 +1199,9 @@ $(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_NoexPrecompiledHeader_ge $(call gb_NoexPrecompiledHeader_get_target,$(3)) : $(2).cxx $(call gb_LinkTarget_get_target,$(1)) : PCH_NAME := $(3) -$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS = $(call gb_PrecompiledHeader_get_target,$(3)).obj $(call gb_NoexPrecompiledHeader_get_target,$(3)).obj +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJEX = $(call gb_PrecompiledHeader_get_target,$(3)).obj +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJNOEX = $(call gb_NoexPrecompiledHeader_get_target,$(3)).obj +$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS = $$(PCHOBJEX) $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : DEFS := $$(DEFS) -DPRECOMPILED_HEADERS diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 0ce41541e907..04209f999385 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -90,6 +90,12 @@ endef # PrecompiledHeader class +# Note: MSVC has a race condition when dealing with .pdb files, that can result in error C1033 when +# the .pdb file already exists and two cl.exe invocations try to modify it at the same time (which +# is apparently most likely when generating both .pch files). The no-exceptions variant should be +# rarely needed now, but in case this turns out to be a problem in practice, this will need to +# be handled somehow (such as order-dependency of one on another). + gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \ -FI$(1).hxx \ -Fp$(call gb_PrecompiledHeader_get_target,$(1)) |