diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 19fbd52aa999c..6cbaf41d16679 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3404,6 +3404,12 @@ function toolset_setup_common_ldlags() ADD_FLAG('LDFLAGS', "/GUARD:CF"); } } + if (PHP_VS_LINK_COMPAT != "no") { + // Allow compatible IL versions, do not require an exact match. + // Prevents build failures where different libs were built with different (but compatible) IL versions. + // See fatal error C1047. + ADD_FLAG("LDFLAGS", "/d2:-AllowCompatibleILVersions "); + } } } @@ -3753,3 +3759,9 @@ function setup_verbosity() CMD_MOD2 = "@"; } } + +try { +ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes'); +} catch (e) { + STDOUT.WriteLine("problem: " + e); +}