C++ 20: Preprocessor definitions (#12324)
* C++ 20: Preprocessor definitions This sets a couple new preprocessor conditions: 1. `FOLLY_CFG_NO_COROUTINES` to prevent types like `folly::optional` from bringing in Folly's coroutine stack when Folly detects C++ 20 coroutines as available. 2. `_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING`: Because the deprecation came before a suitable replacement API. This is more scoped than the `_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS` used by `React.Cpp.props`. * Change files
This commit is contained in:
Родитель
eafc9be3e8
Коммит
1c34a86dd0
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "prerelease",
|
||||
"comment": "C++ 20: Preprocessor definitions",
|
||||
"packageName": "react-native-windows",
|
||||
"email": "ngerlem@fb.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -71,6 +71,7 @@
|
|||
WIN32;
|
||||
_WINDOWS;
|
||||
_USRDLL;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
_WIN32_WINNT=$(WinVer);
|
||||
WIN32;
|
||||
_WINDOWS;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
|
@ -158,4 +159,4 @@
|
|||
</CppWinRTDynamicProjectWinMDReferences>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
_WINDOWS;
|
||||
WIN32;
|
||||
BOOST_ASIO_HAS_IOCP;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
RN_EXPORT=;
|
||||
|
@ -127,4 +128,4 @@
|
|||
<Target Name="Test">
|
||||
<Exec Command="$(OutDir)$(TargetFileName)" IgnoreStandardErrorWarningFormat="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -96,12 +96,15 @@
|
|||
WIN32;
|
||||
CORE_ABI;
|
||||
_WINDOWS;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
RN_PLATFORM=win32;
|
||||
RN_EXPORT=;
|
||||
JSI_EXPORT=;
|
||||
<!-- See https://cplusplus.github.io/LWG/issue3840 -->
|
||||
_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING;
|
||||
%(PreprocessorDefinitions)
|
||||
</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>
|
||||
|
@ -296,4 +299,4 @@
|
|||
<_CppWinRTOriginalRootNamespace />
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -254,7 +254,7 @@
|
|||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(ReactNativeWindowsDir)stubs;$(FollyDir);$(FmtDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>FOLLY_NO_CONFIG;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WINAPI_PARTITION_APP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;NOMINMAX;_CRT_SECURE_NO_WARNINGS;WINAPI_PARTITION_APP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedUsingFiles />
|
||||
<DisableSpecificWarnings>4251;4293;4305;4800;4804;4310;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -328,4 +328,4 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\Fmt\Fmt.vcxproj" Project="{14b93DC8-FD93-4A6D-81CB-8BC96644501C}" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>
|
||||
_HAS_AUTO_PTR_ETC=1;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
WIN32;
|
||||
|
@ -78,4 +79,4 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\Folly\Folly.vcxproj" Project="{A990658C-CE31-4BCC-976F-0FC6B1AF693D}" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<ClCompile>
|
||||
<AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PreprocessorDefinitions>FOLLY_NO_CONFIG;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
|
||||
|
@ -95,4 +95,4 @@
|
|||
<Target Name="Test">
|
||||
<Exec Command="$(OutDir)$(TargetFileName)" IgnoreStandardErrorWarningFormat="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
_WIN32_WINNT=$(WinVer);
|
||||
WIN32;
|
||||
_WINDOWS;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
NOMINMAX;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
|
@ -78,7 +79,7 @@
|
|||
%(PreprocessorDefinitions)
|
||||
</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>
|
||||
$(FmtDir)include;
|
||||
$(ProjectDir)pch;
|
||||
|
@ -231,4 +232,4 @@
|
|||
<PackageReference Include="boost" Version="1.76.0.0" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PreprocessorDefinitions>_CONSOLE;MSO_MOTIFCPP;FOLLY_NO_CONFIG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CONSOLE;MSO_MOTIFCPP;FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/await %(AdditionalOptions) /bigobj</AdditionalOptions>
|
||||
|
@ -169,4 +169,4 @@
|
|||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<Import Project="TestBundle.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
$(GeneratedFilesDir);
|
||||
%(AdditionalIncludeDirectories)
|
||||
</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DISABLE_XAML_GENERATED_MAIN;FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;_USE_MATH_DEFINES;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>DISABLE_XAML_GENERATED_MAIN;FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;_USE_MATH_DEFINES;RN_EXPORT=;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<!--
|
||||
REACTWINDOWS_BUILD - building with REACTWINDOWS_API as dll exports
|
||||
OLD_CPPWINRT is a workaround to make target version to 19H1
|
||||
|
@ -126,12 +126,15 @@
|
|||
REACTWINDOWS_BUILD;
|
||||
RN_PLATFORM=windows;
|
||||
NOMINMAX;
|
||||
FOLLY_CFG_NO_COROUTINES;
|
||||
FOLLY_NO_CONFIG;
|
||||
RN_EXPORT=;
|
||||
JSI_EXPORT=;
|
||||
WIN32=0;
|
||||
WINRT=1;
|
||||
_HAS_AUTO_PTR_ETC;
|
||||
<!-- See https://cplusplus.github.io/LWG/issue3840 -->
|
||||
_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING;
|
||||
%(PreprocessorDefinitions)
|
||||
</PreprocessorDefinitions>
|
||||
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
|
||||
|
@ -674,4 +677,4 @@
|
|||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<ClCompile>
|
||||
<PreprocessorDefinitions>FOLLY_MOBILE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ReactNativeWindowsDir)Common;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)include;$(ReactNativeWindowsDir)Shared;$(ReactNativeWindowsDir)include\Shared;$(YogaDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;RN_EXPORT=;__unused=[[maybe_unused]];%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;NOMINMAX;_HAS_AUTO_PTR_ETC;RN_EXPORT=;__unused=[[maybe_unused]];%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
$(ReactNativeWindowsDir)\Shared\tracing;
|
||||
%(AdditionalIncludeDirectories);
|
||||
</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_WIN32;_CRT_SECURE_NO_WARNINGS;FOLLY_NO_CONFIG;NOMINMAX;RN_EXPORT=;JSI_EXPORT=;WIN32;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WIN32;_CRT_SECURE_NO_WARNINGS;FOLLY_CFG_NO_COROUTINES;FOLLY_NO_CONFIG;NOMINMAX;RN_EXPORT=;JSI_EXPORT=;WIN32;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedUsingFiles />
|
||||
<DisableSpecificWarnings>4715;4251;4800;4804;4305;4722;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
|
@ -246,4 +246,4 @@
|
|||
<Copy DestinationFiles="@(NodeApiJsiFiles->'$(ReactNativeDir)\ReactCommon\jsi\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(NodeApiJsiFiles)" />
|
||||
<Copy DestinationFiles="@(TemporaryReactCommonPatchFiles->'$(ReactNativeDir)\ReactCommon\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(TemporaryReactCommonPatchFiles)" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче