From 57e6662a463bb9753609801703ca351b96fcd033 Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Thu, 14 Jul 2022 06:59:11 -0700 Subject: [PATCH] Folly/Boost integration Summary: This change brings in Folly and Boost into our solution. Boost is resolved with NuGet. Folly is resolved by re-using the RNW integration. For reference: Flipper depends on Folly. Folly depends on a few things: - Boost - FMT - Glog - Double-Conversion Folly from RNW uses some stubs to resolve fmt, glog, and double-conversion. That's OK. Only Boost needs resolving. On Visual Studio, we can use the following package managers: NuGet and vcpkg. Boost can be resolved using either. Using NuGet as otherwise vcpkg needs to be run locally by anybody wanting to build the solution. NuGet makes things easier. Reviewed By: aigoncharov Differential Revision: D36759384 fbshipit-source-id: 31a9a398ce5c5dc2f3def02689ae4bb8c42fbb99 --- .../ReactNativeFlipper.vcxproj | 28 ++++++++++++++++--- .../ReactNativeFlipper.vcxproj.filters | 2 ++ .../ReactNativeFlipper/ReactNativeModule.h | 2 ++ .../windows/ReactNativeFlipper/cpp.hint | 4 +++ .../ReactNativeFlipper/packages.config | 4 +++ .../windows/ReactNativeFlipper/pch.h | 19 ++++++++++++- 6 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 react-native/react-native-flipper/windows/ReactNativeFlipper/cpp.hint create mode 100644 react-native/react-native-flipper/windows/ReactNativeFlipper/packages.config diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj index 07155aff3..fc67e60f8 100644 --- a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj @@ -68,7 +68,8 @@ false - + + @@ -102,12 +103,14 @@ - _DEBUG;%(PreprocessorDefinitions) + _WIN32;_CRT_SECURE_NO_WARNINGS;FOLLY_NO_CONFIG;NOMINMAX;RN_EXPORT=;JSI_EXPORT=;WIN32;_WINDLL;_HAS_AUTO_PTR_ETC;__unused=[[maybe_unused]];FOLLY_MOBILE=1;_USE_MATH_DEFINES;_UNICODE;UNICODE;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;BOOST_ALL_NO_LIB=1;BOOST_ERROR_CODE_HEADER_ONLY;BOOST_NO_RTTI;BOOST_NO_TYPEID;BOOST_SYSTEM_SOURCE;USE_EDGEMODE_JSRT;WIN32_LEAN_AND_MEAN;_DEBUG;_DEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\..\node_modules\.fmt\fmt-7.1.3\include;$(ProjectDir)..\..\node_modules\.folly\folly-2021.06.28.00\;$(ProjectDir)..\..\node_modules\react-native-windows\stubs;%(AdditionalIncludeDirectories) - NDEBUG;%(PreprocessorDefinitions) + _WIN32;_CRT_SECURE_NO_WARNINGS;FOLLY_NO_CONFIG;NOMINMAX;RN_EXPORT=;JSI_EXPORT=;WIN32;_WINDLL;_HAS_AUTO_PTR_ETC;__unused=[[maybe_unused]];FOLLY_MOBILE=1;_USE_MATH_DEFINES;_UNICODE;UNICODE;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;BOOST_ALL_NO_LIB=1;BOOST_ERROR_CODE_HEADER_ONLY;BOOST_NO_RTTI;BOOST_NO_TYPEID;BOOST_SYSTEM_SOURCE;USE_EDGEMODE_JSRT;WIN32_LEAN_AND_MEAN;_DEBUG;NDEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\..\node_modules\.fmt\fmt-7.1.3\include;$(ProjectDir)..\..\node_modules\.folly\folly-2021.06.28.00\;$(ProjectDir)..\..\node_modules\react-native-windows\stubs;%(AdditionalIncludeDirectories) @@ -130,14 +133,25 @@ + + + + + {14b93dc8-fd93-4a6d-81cb-8bc96644501c} + + + {a990658c-ce31-4bcc-976f-0fc6b1af693d} + + + @@ -146,4 +160,10 @@ - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj.filters b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj.filters index b3d8766a7..cf0bbe70b 100644 --- a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj.filters +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeFlipper.vcxproj.filters @@ -15,5 +15,7 @@ + + \ No newline at end of file diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeModule.h b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeModule.h index c82e3b83d..1d5284735 100644 --- a/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeModule.h +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/ReactNativeModule.h @@ -7,6 +7,8 @@ #pragma once +#include +#include #include "JSValue.h" #include "NativeModules.h" diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/cpp.hint b/react-native/react-native-flipper/windows/ReactNativeFlipper/cpp.hint new file mode 100644 index 000000000..3612e314a --- /dev/null +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/cpp.hint @@ -0,0 +1,4 @@ +// Hint files help the Visual Studio IDE interpret Visual C++ identifiers +// such as names of functions and macros. +// For more information see https://go.microsoft.com/fwlink/?linkid=865984 +#define REACT_MODULE(__VA_ARGS__) INTERNAL_REACT_MODULE(__VA_ARGS__)(__VA_ARGS__) diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/packages.config b/react-native/react-native-flipper/windows/ReactNativeFlipper/packages.config new file mode 100644 index 000000000..7b5ca4484 --- /dev/null +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/react-native/react-native-flipper/windows/ReactNativeFlipper/pch.h b/react-native/react-native-flipper/windows/ReactNativeFlipper/pch.h index 3c955e33c..e5c04b741 100644 --- a/react-native/react-native-flipper/windows/ReactNativeFlipper/pch.h +++ b/react-native/react-native-flipper/windows/ReactNativeFlipper/pch.h @@ -10,10 +10,27 @@ #define NOMINMAX #include + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + #include #include #include -#include + #if __has_include() #include #endif