Skip to content

Commit 6b765a7

Browse files
authored
Normalizes headers for clang builds (#12573)
* Normalizes headers for clang builds Normalizes a few react-native-windows #includes to simplify our clang builds. Specifically: 1. All includes of `vnext/codegen` module headers use `codegen/` header namespace. 2. `IReactNotificationService.h` should not use the `Microsoft.ReactNative` header namespace 3. `glog/logging.h` is needed to compile PaperUIManagerModule.h (the `CHECK` callsites) 4. Switch `jsiexecutor/jsireact/JSIExecutor.h` to `jsireact/JSIExecutor.h` to match upstream mobile RN header namespacing expectations. * Change files
1 parent f358dc2 commit 6b765a7

File tree

11 files changed

+19
-9
lines changed

11 files changed

+19
-9
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Normalizes headers for clang builds",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<ReactNativeDir Condition="'$(ReactNativeDir)' == '' AND Exists('$(MSBuildThisFileDirectory)..\..\..\node_modules\react-native\package.json')">$(MSBuildThisFileDirectory)..\..\..\node_modules\react-native</ReactNativeDir>
99
<JSI_SourcePath Condition="'$(JSI_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\jsi</JSI_SourcePath>
1010
<JSI_SourcePath Condition="'$(JSI_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)jsi\jsi.h')">$(MSBuildThisFileDirectory)</JSI_SourcePath>
11+
<JSIExecutor_SourcePath Condition="'$(JSIExecutor_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\jsiexecutor</JSIExecutor_SourcePath>
12+
<JSIExecutor_SourcePath Condition="'$(JSIExecutor_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)jsireact\JSIExecutor.h')">$(MSBuildThisFileDirectory)</JSIExecutor_SourcePath>
1113
<CallInvoker_SourcePath Condition="'$(CallInvoker_SourcePath)' == '' AND '$(ReactNativeDir)' != ''">$(ReactNativeDir)\ReactCommon\callinvoker</CallInvoker_SourcePath>
1214
<CallInvoker_SourcePath Condition="'$(CallInvoker_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)ReactCommon\CallInvoker.h')">$(MSBuildThisFileDirectory)</CallInvoker_SourcePath>
1315
<CallInvoker_SourcePath Condition="'$(CallInvoker_SourcePath)' == '' AND Exists('$(MSBuildThisFileDirectory)ReactCommon\SchedulerPriority.h')">$(MSBuildThisFileDirectory)</CallInvoker_SourcePath>
@@ -29,6 +31,7 @@
2931
<AdditionalIncludeDirectories>
3032
$(MSBuildThisFileDirectory);
3133
$(JSI_SourcePath);
34+
$(JSIExecutor_SourcePath);
3235
$(CallInvoker_SourcePath);
3336
$(TurboModule_SourcePath);
3437
$(Bridging_SourcePath);
@@ -166,4 +169,4 @@
166169
<ItemGroup>
167170
<None Include="$(MSBuildThisFileDirectory)README.md" />
168171
</ItemGroup>
169-
</Project>
172+
</Project>

vnext/Microsoft.ReactNative/Modules/ImageViewManagerModule.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#pragma once
55

66
#include "codegen/NativeImageLoaderIOSSpec.g.h"
7-
#include <NativeImageLoaderIOSSpec.g.h>
87
#include <NativeModules.h>
98
#include <winrt/Windows.ApplicationModel.h>
109
#include <winrt/Windows.Foundation.h>

vnext/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <Views/ViewManager.h>
1212
#include <XamlUtils.h>
1313
#include <cxxreact/SystraceSection.h>
14+
#include <glog/logging.h>
1415
#include "ShadowNodeBase.h"
1516
#include "Unicode.h"
1617
#include "XamlUIService.h"

vnext/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "MsoReactContext.h"
55
#include <winrt/Microsoft.ReactNative.h>
6-
#include "Microsoft.ReactNative/IReactNotificationService.h"
6+
#include "IReactNotificationService.h"
77
#include "MsoUtils.h"
88
#include "ReactInstanceWin.h"
99

vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#endif
1717
#include "ReactErrorProvider.h"
1818

19-
#include "Microsoft.ReactNative/IReactNotificationService.h"
19+
#include "IReactNotificationService.h"
2020
#include "NativeModules.h"
2121
#include "NativeModulesProvider.h"
2222
#include "Unicode.h"

vnext/Shared/Modules/BlobModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#pragma once
55

6-
#include <NativeBlobModuleSpec.g.h>
6+
#include <codegen/NativeBlobModuleSpec.g.h>
77

88
#include <Networking/IBlobResource.h>
99

vnext/Shared/Modules/FileReaderModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#pragma once
55

6-
#include <NativeFileReaderModuleSpec.g.h>
6+
#include <codegen/NativeFileReaderModuleSpec.g.h>
77

88
#include <IFileReaderResource.h>
99
#include <NativeModules.h>

vnext/Shared/Modules/HttpModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#pragma once
55

6-
#include <NativeNetworkingIOSSpec.g.h>
6+
#include <codegen/NativeNetworkingIOSSpec.g.h>
77
#include <NativeModules.h>
88
#include <Networking/IHttpResource.h>
99

vnext/Shared/Modules/WebSocketTurboModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#pragma once
55

6-
#include <NativeWebSocketModuleSpec.g.h>
6+
#include <codegen/NativeWebSocketModuleSpec.g.h>
77
#include <Modules/IWebSocketModuleProxy.h>
88
#include <NativeModules.h>
99
#include <Networking/IWebSocketResource.h>

0 commit comments

Comments
 (0)