[CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2018 20:01:22 +0000 (20:01 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2018 20:01:22 +0000 (20:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182883

Reviewed by Per Arne Vollan.

.:

* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:

Source/WebCore:

No new tests. No change in behavior.

* WebCorePrefix.h:
* config.h:
* testing/js/WebCoreTestSupportPrefix.h:

Source/WebKit:

* config.h:

Source/WebKitLegacy/win:

* WebKitPrefix.h:

Source/WTF:

* wtf/Platform.h:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
ChangeLog
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/WebCorePrefix.h
Source/WebCore/config.h
Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
Source/WebKit/ChangeLog
Source/WebKit/config.h
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebKitPrefix.h
Source/cmake/OptionsAppleWin.cmake
Source/cmake/OptionsWin.cmake
Source/cmake/OptionsWinCairo.cmake
Tools/ChangeLog
Tools/DumpRenderTree/config.h
Tools/TestWebKitAPI/config.h

index e45723b..5ee473c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        * Source/cmake/OptionsAppleWin.cmake:
+        * Source/cmake/OptionsWin.cmake:
+        * Source/cmake/OptionsWinCairo.cmake:
+
 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [GTK] USE_UPOWER causes crashes inside a chroot or on systems with broken dbus/upower
index 0a1af08..ebb4bc2 100644 (file)
@@ -1,3 +1,12 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        * wtf/Platform.h:
+
 2018-02-14  Brian Burg  <bburg@apple.com>
 
         Web Automation: combine session commands to resize and move top-level browsing contexts
index c02b66d..8ad8441 100644 (file)
 /* Graphics engines */
 
 /* USE(CG) and PLATFORM(CI) */
-#if PLATFORM(COCOA) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO) && !USE(DIRECT2D))
+#if PLATFORM(COCOA)
 #define USE_CG 1
-#endif
-#if PLATFORM(COCOA) || (PLATFORM(WIN) && USE(CG) && !USE(DIRECT2D))
 #define USE_CA 1
 #endif
 
 
 #endif /* PLATFORM(IOS) */
 
-#if PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)
-#define USE_CFURLCONNECTION 1
-#endif
-
 #if !defined(HAVE_ACCESSIBILITY)
 #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(WPE)
 #define HAVE_ACCESSIBILITY 1
 #define USE_EGL 1
 #endif
 
-#if ENABLE(VIDEO) && PLATFORM(WIN_CAIRO)
-#if ENABLE(GSTREAMER_WINCAIRO)
-#define USE_MEDIA_FOUNDATION 0
-#define USE_GLIB 1
-#define USE_GSTREAMER 1
-#else
-#define USE_MEDIA_FOUNDATION 1
-#endif
-#endif
-
-#if PLATFORM(WIN_CAIRO)
-#define USE_TEXTURE_MAPPER 1
-#endif
-
 #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_3D) && !defined(USE_TEXTURE_MAPPER_GL)
 #define USE_TEXTURE_MAPPER_GL 1
 #endif
index 1ca33d6..26a2e77 100644 (file)
@@ -1,3 +1,16 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        No new tests. No change in behavior.
+
+        * WebCorePrefix.h:
+        * config.h:
+        * testing/js/WebCoreTestSupportPrefix.h:
+
 2018-02-21  Zalan Bujtas  <zalan@apple.com>
 
         [RenderTreeBuilder] Move RenderView::willBeRemoved() mutation logic to RenderTreeBuilder
index 831f02c..c0650a1 100644 (file)
 #endif
 
 #if OS(WINDOWS)
-
-#if !USE(CURL)
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-#endif
-
 #undef WEBCORE_EXPORT
 #define WEBCORE_EXPORT WTF_EXPORT_DECLARATION
-
 #else
-
 #include <pthread.h>
-
 #endif // OS(WINDOWS)
 
 #include <sys/types.h>
index b97446e..6e5c16b 100644 (file)
 #define HAVE_FUNC_USLEEP 1
 #endif /* __APPLE__ */
 
-#if OS(WINDOWS)
-
-// CURL needs winsock, so don't prevent inclusion of it
-#if !USE(CURL)
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-#endif
-
-#endif /* OS(WINDOWS) */
-
 // Using CMake with Unix makefiles does not use prefix headers.
 #if PLATFORM(MAC) && defined(BUILDING_WITH_CMAKE)
 #include "WebCorePrefix.h"
 
 #include <wtf/DisallowCType.h>
 
-#if PLATFORM(WIN)
-#if PLATFORM(WIN_CAIRO)
-#undef USE_CG
-#define USE_CURL 1
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-#elif USE(DIRECT2D)
-#undef USE_CA
-#undef USE_CG
-#elif !USE(WINGDI)
-#define USE_CG 1
-#undef USE_CAIRO
-#undef USE_CURL
-#endif
-#endif
-
 #if PLATFORM(MAC) || PLATFORM(WPE)
 #define USE_NEW_THEME 1
 #endif
index fe3a7f5..81c8190 100644 (file)
 #endif
 
 #if OS(WINDOWS)
-
-#if !USE(CURL)
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-#endif
-
 #undef WEBCORE_EXPORT
 #define WEBCORE_EXPORT WTF_IMPORT_DECLARATION
 #define WEBCORE_TESTSUPPORT_EXPORT WTF_EXPORT_DECLARATION
-
 #else
 
 #include <pthread.h>
index 6033107..c54fede 100644 (file)
@@ -1,3 +1,12 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        * config.h:
+
 2018-02-21  Brian Burg  <bburg@apple.com>
 
         Web Automation: failed provisional loads cause "Navigate To" command to hang
index 9dbdadc..b6f9703 100644 (file)
 #include <wtf/DisallowCType.h>
 
 #if PLATFORM(WIN)
-
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-
 #undef WEBCORE_EXPORT
 #define WEBCORE_EXPORT WTF_EXPORT_DECLARATION
-
 #endif // PLATFORM(WIN)
 
 #ifdef __cplusplus
index 061ffd3..8dedbb6 100644 (file)
@@ -1,3 +1,12 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        * WebKitPrefix.h:
+
 2018-02-16  Dean Jackson  <dino@apple.com>
 
         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
index 1596ae2..3525310 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */ 
 
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-
 // Needed for limit defines, like INTMAX_MAX, which is used by the std C++ library
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
index ea8d827..7a5dac4 100644 (file)
@@ -7,9 +7,6 @@ include(OptionsWin)
 SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
 SET_AND_EXPOSE_TO_BUILD(USE_CFURLCONNECTION ON)
 
-set(USE_CA 1)
-set(USE_ICU_UNICODE 1)
-
 # Libraries where find_package does not work
 set(COREFOUNDATION_LIBRARY CoreFoundation${DEBUG_SUFFIX})
 set(LIBXML2_LIBRARIES libxml2${DEBUG_SUFFIX})
@@ -22,7 +19,10 @@ set(ZLIB_LIBRARIES zdll${DEBUG_SUFFIX})
 # set(USE_DIRECT2D 1)
 
 if (${USE_DIRECT2D})
-    add_definitions(-DUSE_DIRECT2D=1)
+    SET_AND_EXPOSE_TO_BUILD(USE_DIRECT2D ON)
+else ()
+    SET_AND_EXPOSE_TO_BUILD(USE_CA ON)
+    SET_AND_EXPOSE_TO_BUILD(USE_CG ON)
 endif ()
 
 # Warnings as errors (ignore narrowing conversions)
index eea2054..3b1e057 100644 (file)
@@ -146,3 +146,7 @@ set(WebKitLegacy_LIBRARY_TYPE SHARED)
 
 find_package(ICU REQUIRED)
 add_definitions(-DUCHAR_TYPE=wchar_t)
+
+# If <winsock2.h> is not included before <windows.h> redefinition errors occur
+# unless _WINSOCKAPI_ is defined before <windows.h> is included
+add_definitions(-D_WINSOCKAPI_=)
index 17bd0f7..4eccbce 100644 (file)
@@ -27,12 +27,12 @@ endif ()
 
 SET_AND_EXPOSE_TO_BUILD(USE_CAIRO ON)
 SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
+SET_AND_EXPOSE_TO_BUILD(USE_CURL ON)
+SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER ON)
+SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER_GL ON)
+SET_AND_EXPOSE_TO_BUILD(USE_MEDIA_FOUNDATION ON)
 
-set(USE_CURL 1)
-set(USE_ICU_UNICODE 1)
-set(USE_TEXTURE_MAPPER_GL 1)
-
-set(ENABLE_GRAPHICS_CONTEXT_3D 1)
+set(ENABLE_GRAPHICS_CONTEXT_3D ON)
 
 set(COREFOUNDATION_LIBRARY CFlite)
 
index b73faef..d7b5064 100644 (file)
@@ -1,3 +1,13 @@
+2018-02-21  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=182883
+
+        Reviewed by Per Arne Vollan.
+
+        * DumpRenderTree/config.h:
+        * TestWebKitAPI/config.h:
+
 2018-02-21  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [GTK] Unsafe g_setenv use in MiniBrowser main
index 883fc53..3f90846 100644 (file)
 #if PLATFORM(COCOA)
 #define USE_CF 1
 #endif
-
-#if PLATFORM(WIN)
-#if PLATFORM(WIN_CAIRO)
-#define USE_CURL 1
-#else
-#define USE_CG 1
-#endif
-
-#undef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif  // PLATFORM(WIN)
index 1db06a5..24b850c 100644 (file)
@@ -34,7 +34,6 @@
 #endif
 
 #if defined(__APPLE__) && __APPLE__
-
 #ifdef __OBJC__
 #if PLATFORM(IOS)
 #import <Foundation/Foundation.h>
 #import <Cocoa/Cocoa.h>
 #endif
 #endif
-
-#elif PLATFORM(WIN)
-
-#if PLATFORM(WIN_CAIRO)
-#undef USE_CG
-#define USE_CURL 1
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#endif
-#else
-#define USE_CG 1
-#undef USE_CAIRO
-#undef USE_CURL
 #endif
 
-#endif // PLATFORM(WIN)
-
 #include <stdint.h>
 
 #if !PLATFORM(IOS) && !PLATFORM(WIN) && !defined(BUILDING_JSCONLY__)