Fix quirks in CMake build on Mac and Windows
[WebKit-https.git] / Source / cmake / OptionsWindows.cmake
1 add_definitions(-D_HAS_EXCEPTIONS=0 -DNOMINMAX -DUNICODE)
2
3 #FIXME: Make sure these are the same as the Windows feature defines once we get CMake working on Windows.
4 WEBKIT_OPTION_BEGIN()
5 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON)
6 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC ON)
7 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LEGACY_VENDOR_PREFIXES PUBLIC OFF)
8 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PROMISES PUBLIC ON)
9 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PICTURE_SIZES PUBLIC OFF)
10 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_STREAMS_API PUBLIC ON)
11 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIEW_MODE_CSS_MEDIA PUBLIC OFF)
12 WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PUBLIC ON)
13 WEBKIT_OPTION_END()
14
15 include_directories("$ENV{WEBKIT_LIBRARIES}/include")
16 link_directories("$ENV{WEBKIT_LIBRARIES}/lib$(PlatformArchitecture)")
17 if (MSVC)
18     add_definitions(
19         /wd4018 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4146 /wd4180 /wd4189 /wd4201 /wd4244 /wd4251 /wd4267 /wd4275 /wd4288
20         /wd4291 /wd4305 /wd4309 /wd4344 /wd4355 /wd4389 /wd4396 /wd4481 /wd4503 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4702
21         /wd4706 /wd4800 /wd4819 /wd4951 /wd4952 /wd4996 /wd6011 /wd6031 /wd6211 /wd6246 /wd6255 /wd6387
22         /MP
23     )
24     string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable C++ exceptions
25     string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable RTTI
26 endif ()
27
28 set(PORT Win)
29 set(JavaScriptCore_LIBRARY_TYPE SHARED)
30 set(WTF_LIBRARY_TYPE SHARED)
31 set(ICU_LIBRARIES libicuuc$(DebugSuffix) libicuin$(DebugSuffix))