Finish encoding/decoding support for DisplayList::SetState
[WebKit-https.git] / Source / cmake / OptionsAppleWin.cmake
1 # The static runtime is required for AppleWin due to WebKitSystemInterface.lib
2 # being compiled with a static runtime.
3 set(MSVC_STATIC_RUNTIME ON)
4
5 include(OptionsWin)
6
7 set(ENABLE_WEBCORE ON)
8
9 SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
10 SET_AND_EXPOSE_TO_BUILD(USE_CFURLCONNECTION ON)
11
12 # Libraries where find_package does not work
13 set(COREFOUNDATION_LIBRARY CoreFoundation${DEBUG_SUFFIX})
14 set(LIBXML2_LIBRARIES libxml2${DEBUG_SUFFIX})
15 set(LIBXSLT_LIBRARIES libxslt${DEBUG_SUFFIX})
16 set(SQLITE_LIBRARIES SQLite3${DEBUG_SUFFIX})
17 set(ZLIB_INCLUDE_DIRS "${WEBKIT_LIBRARIES_DIR}/include/zlib")
18 set(ZLIB_LIBRARIES zdll${DEBUG_SUFFIX})
19
20 include(target/icu)
21
22 # Uncomment the following line to try the Direct2D backend.
23 # set(USE_DIRECT2D 1)
24
25 if (${USE_DIRECT2D})
26     SET_AND_EXPOSE_TO_BUILD(USE_DIRECT2D ON)
27 else ()
28     SET_AND_EXPOSE_TO_BUILD(USE_CA ON)
29     SET_AND_EXPOSE_TO_BUILD(USE_CG ON)
30
31     set(CMAKE_REQUIRED_INCLUDES ${WEBKIT_LIBRARIES_INCLUDE_DIR})
32     set(CMAKE_REQUIRED_LIBRARIES
33         "${WEBKIT_LIBRARIES_LINK_DIR}/CoreFoundation${DEBUG_SUFFIX}.lib"
34         "${WEBKIT_LIBRARIES_LINK_DIR}/AVFoundationCF${DEBUG_SUFFIX}.lib"
35         "${WEBKIT_LIBRARIES_LINK_DIR}/QuartzCore${DEBUG_SUFFIX}.lib"
36         "${WEBKIT_LIBRARIES_LINK_DIR}/libdispatch${DEBUG_SUFFIX}.lib"
37     )
38
39     WEBKIT_CHECK_HAVE_INCLUDE(HAVE_AVCF AVFoundationCF/AVCFBase.h)
40
41     if (HAVE_AVCF)
42          SET_AND_EXPOSE_TO_BUILD(USE_AVFOUNDATION ON)
43     endif ()
44
45     WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVCF_LEGIBLE_OUTPUT AVCFPlayerItemLegibleOutputSetCallbacks "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h;AVFoundationCF/AVCFPlayerItemLegibleOutput.h")
46     WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVFOUNDATION_LOADER_DELEGATE AVCFAssetResourceLoaderSetCallbacks "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h")
47     WEBKIT_CHECK_HAVE_SYMBOL(HAVE_AVCFURL_PLAYABLE_MIMETYPE AVCFURLAssetIsPlayableExtendedMIMEType "TargetConditionals.h;dispatch/dispatch.h;AVFoundationCF/AVFoundationCF.h")
48
49     # CMake cannot identify an enum through a symbol check so a source file is required
50     WEBKIT_CHECK_SOURCE_COMPILES(HAVE_AVCFPLAYERITEM_CALLBACK_VERSION_2 "
51     #include <AVFoundationCF/AVFoundationCF.h>
52     #include <AVFoundationCF/AVCFPlayerItemLegibleOutput.h>
53     #include <CoreFoundation/CoreFoundation.h>
54     #include <dispatch/dispatch.h>
55
56     int main() {
57         CFArrayRef types = CFArrayCreate(kCFAllocatorDefault, nullptr, 0, nullptr);
58         AVCFPlayerItemLegibleOutputRef legibleOutput = AVCFPlayerItemLegibleOutputCreateWithMediaSubtypesForNativeRepresentation(kCFAllocatorDefault, types);
59         AVCFPlayerItemLegibleOutputCallbacks callbackInfo;
60         callbackInfo.version = kAVCFPlayerItemLegibleOutput_CallbacksVersion_2;
61         dispatch_queue_t dispatchQueue = dispatch_queue_create(\"test\", DISPATCH_QUEUE_SERIAL);
62         AVCFPlayerItemLegibleOutputSetCallbacks(legibleOutput, &callbackInfo, dispatchQueue);
63     }")
64
65     if (HAVE_AVCF_LEGIBLE_OUTPUT)
66         SET_AND_EXPOSE_TO_BUILD(HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP ON)
67         SET_AND_EXPOSE_TO_BUILD(HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT ON)
68         SET_AND_EXPOSE_TO_BUILD(HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK ON)
69     endif ()
70
71     WEBKIT_CHECK_HAVE_SYMBOL(HAVE_CACFLAYER_SETCONTENTSSCALE CACFLayerSetContentsScale QuartzCore/CoreAnimationCF.h)
72 endif ()
73
74 # Warnings as errors (ignore narrowing conversions)
75 add_compile_options(/WX /Wv:18)
76
77 if (INTERNAL_BUILD)
78     set(WTF_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/WTF/Scripts")
79     set(JavaScriptCore_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore/Scripts")
80 endif ()