Просмотр исходного кода

[shell_integration] Setup precompiled headers properly with MSVC

This also fixes a minor compile error when using VS Express.
Jocelyn Turcotte 11 лет назад
Родитель
Сommit
2debd5a198

+ 0 - 3
shell_integration/windows/OCContextMenu/OCContextMenu.h

@@ -16,10 +16,7 @@
 #define OCCONTEXTMENU_H
 
 #pragma once
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
 #include <shlobj.h>     // For IShellExtInit and IContextMenu
-#include <memory>
 
 class OCContextMenu : public IShellExtInit, public IContextMenu
 {

+ 3 - 0
shell_integration/windows/OCContextMenu/OCContextMenu.vcxproj.filters

@@ -36,6 +36,9 @@
     <ClInclude Include="OCClientInterface.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="RegDelnode.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="stdafx.cpp">

+ 1 - 0
shell_integration/windows/OCContextMenu/stdafx.h

@@ -10,6 +10,7 @@
 #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
 // Windows Header Files:
 #include <windows.h>
+#include <memory>
 #include <strsafe.h>
 
 

+ 2 - 1
shell_integration/windows/OCOverlays/DllMain.cpp

@@ -12,9 +12,10 @@
  * details.
  */
 
+#include "stdafx.h"
+
 #include "OCOverlayRegistrationHandler.h"
 #include "OCOverlayFactory.h"
-#include "stdafx.h"
 
 HINSTANCE instanceHandle = NULL;
 

+ 2 - 0
shell_integration/windows/OCOverlays/OCOverlay.cpp

@@ -12,6 +12,8 @@
  * details.
  */
 
+#include "stdafx.h"
+
 #include "OCOverlay.h"
 
 #include "OCOverlayFactory.h"

+ 0 - 2
shell_integration/windows/OCOverlays/OCOverlay.h

@@ -15,8 +15,6 @@
 #ifndef OCOVERLAY_H
 #define OCOVERLAY_H
 
-#include "stdafx.h"
-
 #pragma once
 
 class RemotePathChecker;

BIN
shell_integration/windows/OCOverlays/OCOverlay.rc


+ 2 - 0
shell_integration/windows/OCOverlays/OCOverlayFactory.cpp

@@ -12,6 +12,8 @@
  * details.
  */
 
+#include "stdafx.h"
+
 #include "OCOverlayFactory.h"
 #include "OCOverlay.h"
 

+ 0 - 2
shell_integration/windows/OCOverlays/OCOverlayFactory.h

@@ -17,8 +17,6 @@
 
 #pragma once
 
-#include "stdafx.h"
-
 enum State {
 	State_Error = 0, State_ErrorShared,
 	State_OK, State_OKShared,

+ 2 - 1
shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp

@@ -12,9 +12,10 @@
  * details.
  */
 
-#include "OCOverlayRegistrationHandler.h"
 #include "stdafx.h"
 
+#include "OCOverlayRegistrationHandler.h"
+
 #include <iostream>
 #include <fstream>
 

+ 0 - 2
shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.h

@@ -17,8 +17,6 @@
 
 #pragma once
 
-#include "stdafx.h"
-
 class __declspec(dllexport) OCOverlayRegistrationHandler 
 {
 	public:

+ 5 - 0
shell_integration/windows/OCOverlays/OCOverlays.vcxproj

@@ -95,6 +95,7 @@
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\OCUtil;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <SuppressStartupBanner>false</SuppressStartupBanner>
+      <PrecompiledHeader>Use</PrecompiledHeader>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -160,6 +161,10 @@
     <ClCompile Include="OCOverlay.cpp" />
     <ClCompile Include="OCOverlayFactory.cpp" />
     <ClCompile Include="OCOverlayRegistrationHandler.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="OCOverlay.h" />

+ 1 - 0
shell_integration/windows/OCOverlays/stdafx.cpp

@@ -0,0 +1 @@
+#include "stdafx.h"

+ 2 - 0
shell_integration/windows/OCUtil/FileUtil.cpp

@@ -12,6 +12,8 @@
  * details.
  */
 
+#include "stdafx.h"
+
 #include "FileUtil.h"
 #include "RegistryUtil.h"
 #include "UtilConstants.h"

+ 6 - 0
shell_integration/windows/OCUtil/OCUtil.vcxproj

@@ -93,6 +93,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <ShowIncludes>false</ShowIncludes>
+      <PrecompiledHeader>Use</PrecompiledHeader>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -143,6 +144,7 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="RemotePathChecker.h" />
+    <ClInclude Include="stdafx.h" />
     <ClInclude Include="StringUtil.h" />
     <ClInclude Include="UtilConstants.h" />
     <ClInclude Include="CommunicationSocket.h" />
@@ -154,6 +156,10 @@
     <ClCompile Include="RemotePathChecker.cpp" />
     <ClCompile Include="FileUtil.cpp" />
     <ClCompile Include="RegistryUtil.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
     <ClCompile Include="StringUtil.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 2 - 2
shell_integration/windows/OCUtil/RegistryUtil.cpp

@@ -12,9 +12,9 @@
  * details.
  */
 
-#include "RegistryUtil.h"
+#include "stdafx.h"
 
-#include <windows.h>
+#include "RegistryUtil.h"
 
 using namespace std;
 

+ 2 - 0
shell_integration/windows/OCUtil/RemotePathChecker.cpp

@@ -11,6 +11,8 @@
 * details.
 */
 
+#include "stdafx.h"
+
 #include "CommunicationSocket.h"
 
 #include "RemotePathChecker.h"

+ 2 - 0
shell_integration/windows/OCUtil/StringUtil.cpp

@@ -11,6 +11,8 @@
 * details.
 */
 
+#include "stdafx.h"
+
 #include <locale>
 #include <string>
 #include <codecvt>

+ 1 - 0
shell_integration/windows/OCUtil/stdafx.cpp

@@ -0,0 +1 @@
+#include "stdafx.h"

+ 5 - 0
shell_integration/windows/OCUtil/stdafx.h

@@ -0,0 +1,5 @@
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN
+
+#include <windows.h>