[CMake] Make USE_CF conditional within Windows
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 00:36:53 +0000 (00:36 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 00:36:53 +0000 (00:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176173

Reviewed by Alex Christensen.

.:

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

Source/JavaScriptCore:

* PlatformWin.cmake:

Source/WebCore:

No new tests. No change in behavior.

* PlatformWin.cmake:
* WebCorePrefix.h:
* testing/js/WebCoreTestSupportPrefix.h:

Source/WebKitLegacy:

* PlatformWin.cmake:

Source/WTF:

* wtf/Platform.h:
* wtf/PlatformWin.cmake:

Tools:

* DumpRenderTree/config.h:
* MiniBrowser/win/CMakeLists.txt:
* MiniBrowser/win/stdafx.h:
* TestWebKitAPI/PlatformWin.cmake:

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

19 files changed:
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformWin.cmake
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WTF/wtf/PlatformWin.cmake
Source/WebCore/ChangeLog
Source/WebCore/PlatformWin.cmake
Source/WebCore/WebCorePrefix.h
Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformWin.cmake
Source/cmake/OptionsAppleWin.cmake
Source/cmake/OptionsWinCairo.cmake
Tools/ChangeLog
Tools/DumpRenderTree/config.h
Tools/MiniBrowser/win/CMakeLists.txt
Tools/MiniBrowser/win/stdafx.h
Tools/TestWebKitAPI/PlatformWin.cmake

index 2d9f7aa..2b6a444 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        * Source/cmake/OptionsAppleWin.cmake:
+        * Source/cmake/OptionsWinCairo.cmake:
+
 2017-08-30  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake][WinCairo] Use find_package for libpng and libjpeg
index f9ae6e3..995898c 100644 (file)
@@ -1,3 +1,12 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        * PlatformWin.cmake:
+
 2017-08-31  Saam Barati  <sbarati@apple.com>
 
         useSeparatedWXHeap should never be true when not on iOS
index 5ae4004..b348eae 100644 (file)
@@ -1,19 +1,23 @@
 list(APPEND JavaScriptCore_SOURCES
     API/JSStringRefBSTR.cpp
-    API/JSStringRefCF.cpp
 )
 
 list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
     ${CMAKE_BINARY_DIR}/../include/private
 )
 
-if (WTF_PLATFORM_WIN_CAIRO)
+if (USE_CF)
+    list(APPEND JavaScriptCore_SOURCES
+        API/JSStringRefCF.cpp
+    )
+
     list(APPEND JavaScriptCore_LIBRARIES
-        CFLite
+        ${COREFOUNDATION_LIBRARY}
     )
-else ()
+endif ()
+
+if (NOT WTF_PLATFORM_WIN_CAIRO)
     list(APPEND JavaScriptCore_LIBRARIES
-        CoreFoundation${DEBUG_SUFFIX}
         ${ICU_LIBRARIES}
         winmm
     )
index 27c4204..670d89c 100644 (file)
@@ -1,3 +1,13 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Platform.h:
+        * wtf/PlatformWin.cmake:
+
 2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r221445.
index 06434af..cd7a7af 100644 (file)
 
 #endif /* PLATFORM(IOS) */
 
-#if PLATFORM(WIN) && !USE(WINGDI)
-#define USE_CF 1
-#endif
-
 #if PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)
 #define USE_CFURLCONNECTION 1
 #endif
index 0b91634..780ef82 100644 (file)
@@ -7,11 +7,6 @@ list(APPEND WTF_SOURCES
 
     text/win/TextBreakIteratorInternalICUWin.cpp
 
-    text/cf/AtomicStringImplCF.cpp
-    text/cf/StringCF.cpp
-    text/cf/StringImplCF.cpp
-    text/cf/StringViewCF.cpp
-
     win/CPUTimeWin.cpp
     win/MainThreadWin.cpp
     win/MemoryFootprintWin.cpp
@@ -24,14 +19,15 @@ list(APPEND WTF_HEADERS
     "${DERIVED_SOURCES_WTF_DIR}/AVFoundationHeaderDetection.h"
 )
 
-if (${WTF_PLATFORM_WIN_CAIRO})
-    list(APPEND WTF_LIBRARIES
-        cflite
-    )
-else ()
-    list(APPEND WTF_LIBRARIES
-        CoreFoundation${DEBUG_SUFFIX}
+if (USE_CF)
+    list(APPEND WTF_SOURCES
+        text/cf/AtomicStringImplCF.cpp
+        text/cf/StringCF.cpp
+        text/cf/StringImplCF.cpp
+        text/cf/StringViewCF.cpp
     )
+
+    list(APPEND WTF_LIBRARIES ${COREFOUNDATION_LIBRARY})
 endif ()
 
 add_custom_command(
index d1fdc81..e559272 100644 (file)
@@ -1,3 +1,16 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        No new tests. No change in behavior.
+
+        * PlatformWin.cmake:
+        * WebCorePrefix.h:
+        * testing/js/WebCoreTestSupportPrefix.h:
+
 2017-08-31  Sam Weinig  <sam@webkit.org>
 
         Implement DOMMatrix2DInit for setTransform()/addPath()
index ddc8172..9a4b4da 100644 (file)
@@ -28,8 +28,6 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES
     "${FORWARDING_HEADERS_DIR}/WTF"
     "${WEBCORE_DIR}/accessibility/win"
     "${WEBCORE_DIR}/page/win"
-    "${WEBCORE_DIR}/platform/cf"
-    "${WEBCORE_DIR}/platform/cf/win"
     "${WEBCORE_DIR}/platform/graphics/egl"
     "${WEBCORE_DIR}/platform/graphics/opengl"
     "${WEBCORE_DIR}/platform/graphics/opentype"
@@ -50,8 +48,6 @@ list(APPEND WebCore_SOURCES
 
     html/HTMLSelectElementWin.cpp
 
-    loader/archive/cf/LegacyWebArchive.cpp
-
     page/win/DragControllerWin.cpp
     page/win/EventHandlerWin.cpp
     page/win/FrameWin.cpp
@@ -62,15 +58,6 @@ list(APPEND WebCore_SOURCES
 
     platform/audio/PlatformMediaSessionManager.cpp
 
-    platform/cf/CFURLExtras.cpp
-    platform/cf/FileSystemCF.cpp
-    platform/cf/KeyedDecoderCF.cpp
-    platform/cf/KeyedEncoderCF.cpp
-    platform/cf/SharedBufferCF.cpp
-    platform/cf/URLCF.cpp
-
-    platform/cf/win/CertificateCFWin.cpp
-
     platform/graphics/GraphicsContext3DPrivate.cpp
 
     platform/graphics/egl/GLContextEGL.cpp
@@ -110,8 +97,6 @@ list(APPEND WebCore_SOURCES
 
     platform/text/LocaleNone.cpp
 
-    platform/text/cf/HyphenationCF.cpp
-
     platform/win/BString.cpp
     platform/win/BitmapInfo.cpp
     platform/win/ClipboardUtilitiesWin.cpp
@@ -201,8 +186,6 @@ set(WebCore_FORWARDING_HEADERS_DIRECTORIES
 
     css/parser
 
-    history/cf
-
     html/forms
     html/parser
     html/shadow
@@ -213,7 +196,6 @@ set(WebCore_FORWARDING_HEADERS_DIRECTORIES
     loader/cache
     loader/icon
 
-    loader/archive/cf
 
     page/animation
     page/csp
@@ -222,7 +204,6 @@ set(WebCore_FORWARDING_HEADERS_DIRECTORIES
 
     platform/animation
     platform/audio
-    platform/cf
     platform/graphics
     platform/mock
     platform/network
@@ -230,8 +211,6 @@ set(WebCore_FORWARDING_HEADERS_DIRECTORIES
     platform/text
     platform/win
 
-    platform/cf/win
-
     platform/graphics/filters
     platform/graphics/opengl
     platform/graphics/opentype
@@ -255,6 +234,38 @@ set(WebCore_FORWARDING_HEADERS_DIRECTORIES
     svg/graphics/filters
 )
 
+if (USE_CF)
+    list(APPEND WebCore_INCLUDE_DIRECTORIES
+        "${WEBCORE_DIR}/platform/cf"
+        "${WEBCORE_DIR}/platform/cf/win"
+    )
+
+    list(APPEND WebCore_SOURCES
+        loader/archive/cf/LegacyWebArchive.cpp
+
+        platform/cf/CFURLExtras.cpp
+        platform/cf/FileSystemCF.cpp
+        platform/cf/KeyedDecoderCF.cpp
+        platform/cf/KeyedEncoderCF.cpp
+        platform/cf/SharedBufferCF.cpp
+        platform/cf/URLCF.cpp
+
+        platform/cf/win/CertificateCFWin.cpp
+
+        platform/text/cf/HyphenationCF.cpp
+    )
+
+    list(APPEND WebCore_FORWARDING_HEADERS_DIRECTORIES
+        history/cf
+
+        loader/archive/cf
+
+        platform/cf
+
+        platform/cf/win
+    )
+endif ()
+
 if (CMAKE_SIZEOF_VOID_P EQUAL 4)
     list(APPEND WebCore_DERIVED_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/makesafeseh.obj)
     add_custom_command(
index ebfacc6..61a59a5 100644 (file)
@@ -92,7 +92,9 @@
 #include <sys/resource.h>
 #endif
 
+#if USE(CF)
 #include <CoreFoundation/CoreFoundation.h>
+#endif
 
 #if OS(WINDOWS)
 #ifndef CF_IMPLICIT_BRIDGING_ENABLED
 #define CF_IMPLICIT_BRIDGING_DISABLED
 #endif
 
+#if USE(CF)
 #include <CoreFoundation/CFBase.h>
+#endif
 
 #ifndef CF_ENUM
 #define CF_ENUM(_type, _name) _type _name; enum
 #endif
 
 #if PLATFORM(WIN_CAIRO)
-#include <ConditionalMacros.h>
 #include <windows.h>
 #else
 
index ad6959b..fe3a7f5 100644 (file)
 #include <sys/time.h>
 #endif
 
+#if USE(CF)
 #include <CoreFoundation/CoreFoundation.h>
+#endif
+
 #if PLATFORM(WIN_CAIRO)
-#include <ConditionalMacros.h>
 #include <windows.h>
 #else
 
index 6dbe3dc..5dcf519 100644 (file)
@@ -1,3 +1,12 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        * PlatformWin.cmake:
+
 2017-08-30  Andy Estes  <aestes@apple.com>
 
         [Mac] Upstream Carbon-related WebKitSystemInterface functions
index 9c1f1a8..c0a547f 100644 (file)
@@ -21,7 +21,6 @@ else ()
     )
     list(APPEND WebKit_LIBRARIES
         PRIVATE CFNetwork${DEBUG_SUFFIX}
-        PRIVATE CoreFoundation${DEBUG_SUFFIX}
         PRIVATE CoreGraphics${DEBUG_SUFFIX}
         PRIVATE CoreText${DEBUG_SUFFIX}
         PRIVATE QuartzCore${DEBUG_SUFFIX}
@@ -129,8 +128,6 @@ list(APPEND WebKit_INCLUDES
 )
 
 list(APPEND WebKit_SOURCES_Classes
-    cf/WebCoreSupport/WebInspectorClientCF.cpp
-
     win/AccessibleBase.cpp
     win/AccessibleDocument.cpp
     win/AccessibleImage.cpp
@@ -245,6 +242,16 @@ list(APPEND WebKit_SOURCES_WebCoreSupport
     win/WebCoreSupport/WebVisitedLinkStore.h
 )
 
+if (USE_CF)
+    list(APPEND WebKit_SOURCES_Classes
+        cf/WebCoreSupport/WebInspectorClientCF.cpp
+    )
+
+    list(APPEND WebKit_LIBRARIES
+        ${COREFOUNDATION_LIBRARY}
+    )
+endif ()
+
 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
     enable_language(ASM_MASM)
     if (MSVC)
index d315489..47b8dee 100644 (file)
@@ -1,11 +1,13 @@
 include(OptionsWin)
 
-set(USE_CG 1)
+SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
+SET_AND_EXPOSE_TO_BUILD(USE_CFURLCONNECTION ON)
+
 set(USE_CA 1)
-set(USE_CFURLCONNECTION 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})
 set(LIBXSLT_LIBRARIES libxslt${DEBUG_SUFFIX})
 set(SQLITE_LIBRARIES SQLite3${DEBUG_SUFFIX})
index b27dba4..3ccde45 100644 (file)
@@ -16,12 +16,14 @@ if (ENABLE_XSLT)
 endif ()
 
 SET_AND_EXPOSE_TO_BUILD(USE_CAIRO ON)
+SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
 
-set(USE_CF 1)
 set(USE_CURL 1)
 set(USE_ICU_UNICODE 1)
 set(USE_TEXTURE_MAPPER_GL 1)
 
 set(ENABLE_GRAPHICS_CONTEXT_3D 1)
 
+set(COREFOUNDATION_LIBRARY CFlite)
+
 add_definitions(-DWTF_PLATFORM_WIN_CAIRO=1)
index 184ffe6..1065e2b 100644 (file)
@@ -1,3 +1,15 @@
+2017-08-31  Don Olmstead  <don.olmstead@sony.com>
+
+        [CMake] Make USE_CF conditional within Windows
+        https://bugs.webkit.org/show_bug.cgi?id=176173
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/config.h:
+        * MiniBrowser/win/CMakeLists.txt:
+        * MiniBrowser/win/stdafx.h:
+        * TestWebKitAPI/PlatformWin.cmake:
+
 2017-08-31  Filip Pizlo  <fpizlo@apple.com>
 
         WSL should support makeptr (\)
index 78d8500..d43e48d 100644 (file)
 #endif
 
 #if PLATFORM(WIN)
-#define USE_CF 1 
 #if PLATFORM(WIN_CAIRO)
 #define USE_CURL 1
 #else
 #define USE_CG 1
-#define USE_CFURLCONNECTION 1
 #endif
 
 #undef _WINSOCKAPI_
index ffe2593..e4eca5e 100644 (file)
@@ -30,13 +30,9 @@ set(MiniBrowser_LIBRARIES
     shlwapi
 )
 
-if (WTF_PLATFORM_WIN_CAIRO)
+if (USE_CF)
     list(APPEND MiniBrowser_LIBRARIES
-        CFLite
-    )
-else ()
-    list(APPEND MiniBrowser_LIBRARIES
-        CoreFoundation
+        ${COREFOUNDATION_LIBRARY}
     )
 endif ()
 
index 0e0c749..c78d4c1 100644 (file)
 
 #pragma once
 
+#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
+#include "cmakeconfig.h"
+#endif
+
 #define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers
 
 // Needed for limit defines, like INTMAX_MAX, which is used by the std C++ library
index f203950..6ab56ff 100644 (file)
@@ -86,7 +86,6 @@ else ()
     list(APPEND test_webcore_LIBRARIES
         ASL${DEBUG_SUFFIX}
         CFNetwork${DEBUG_SUFFIX}
-        CoreFoundation${DEBUG_SUFFIX}
         CoreGraphics${DEBUG_SUFFIX}
         CoreText${DEBUG_SUFFIX}
         QuartzCore${DEBUG_SUFFIX}
@@ -99,6 +98,12 @@ else ()
     )
 endif ()
 
+if (USE_CF)
+    list(APPEND test_webcore_LIBRARIES
+        ${COREFOUNDATION_LIBRARY}
+    )
+endif ()
+
 add_library(TestWTFLib SHARED
     ${test_main_SOURCES}
     ${TestWTF_SOURCES}