Unreviewed, update Beacon API status to "In Development".
[WebKit-https.git] / CMakeLists.txt
index 91b98d1..f560345 100644 (file)
@@ -1,8 +1,10 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.3)
 project(WebKit)
 
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
 
+set(ENABLE_WEBCORE ON)
+
 if (NOT DEFINED ENABLE_WEBKIT)
     set(ENABLE_WEBKIT ON)
 endif ()
@@ -11,15 +13,18 @@ if (NOT DEFINED ENABLE_TOOLS AND EXISTS "${CMAKE_SOURCE_DIR}/Tools")
     set(ENABLE_TOOLS ON)
 endif ()
 
-include(WebKitMacros)
-include(WebKitFS)
-include(WebKitHelpers)
-include(WebKitFeatures)
-
 # -----------------------------------------------------------------------------
 # Determine which port will be built
 # -----------------------------------------------------------------------------
-set(ALL_PORTS Efl GTK AppleWin WinCairo Mac)
+set(ALL_PORTS
+    AppleWin
+    Efl
+    GTK
+    JSCOnly
+    Mac
+    WPE
+    WinCairo
+)
 set(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
 
 list(FIND ALL_PORTS ${PORT} RET)
@@ -30,6 +35,27 @@ endif ()
 string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
 
 # -----------------------------------------------------------------------------
+# Determine the compiler
+# -----------------------------------------------------------------------------
+if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
+    set(COMPILER_IS_CLANG ON)
+endif ()
+
+if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "5.0.0")
+        message(FATAL_ERROR "GCC 5.0.0 is required to build WebKitGTK+, use a newer GCC version or clang")
+    endif ()
+endif ()
+
+if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
+    set(COMPILER_IS_GCC_OR_CLANG ON)
+endif ()
+
+if (MSVC AND COMPILER_IS_CLANG)
+    set(COMPILER_IS_CLANG_CL ON)
+endif ()
+
+# -----------------------------------------------------------------------------
 # Determine the target processor
 # -----------------------------------------------------------------------------
 # Use MSVC_CXX_ARCHITECTURE_ID instead of CMAKE_SYSTEM_PROCESSOR when defined,
@@ -85,16 +111,17 @@ endif ()
 # -----------------------------------------------------------------------------
 # Default library types
 # -----------------------------------------------------------------------------
-option(SHARED_CORE "build JavaScriptCore and WebCore as shared libraries")
+option(SHARED_CORE "build WebCore as a shared library")
 
 if (SHARED_CORE)
-    set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE SHARED)
 else ()
-    set(JavaScriptCore_LIBRARY_TYPE SHARED)
     set(WebCore_LIBRARY_TYPE STATIC)
 endif ()
 
+set(WTF_LIBRARY_TYPE STATIC)
+set(JavaScriptCore_LIBRARY_TYPE SHARED)
+set(PAL_LIBRARY_TYPE STATIC)
 set(WebKit_LIBRARY_TYPE SHARED)
 set(WebKit2_LIBRARY_TYPE SHARED)
 set(WebCoreTestSupport_LIBRARY_TYPE STATIC)
@@ -105,17 +132,16 @@ set(WebCoreTestSupport_LIBRARY_TYPE STATIC)
 option(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the built JavaScript shell")
 
 # -----------------------------------------------------------------------------
-# Common options
+# Default output directories, which can be overwritten by ports
 #------------------------------------------------------------------------------
-include(OptionsCommon)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
 # -----------------------------------------------------------------------------
-# Port-specific options
-# -----------------------------------------------------------------------------
-include(Options${PORT})
+# Common configuration
+#------------------------------------------------------------------------------
+include(WebKitCommon)
 
 # -----------------------------------------------------------------------------
 # Enable API unit tests and create a target for the test runner
@@ -125,11 +151,6 @@ if (ENABLE_API_TESTS)
 endif ()
 
 # -----------------------------------------------------------------------------
-# Define packaging
-# -----------------------------------------------------------------------------
-include(WebKitPackaging)
-
-# -----------------------------------------------------------------------------
 # Add module directories
 # -----------------------------------------------------------------------------
 add_subdirectory(Source)
@@ -145,8 +166,3 @@ endif ()
 # Print the features list last, for maximum visibility.
 # -----------------------------------------------------------------------------
 PRINT_WEBKIT_OPTIONS()
-
-# -----------------------------------------------------------------------------
-# Create the configuration header
-# -----------------------------------------------------------------------------
-CREATE_CONFIGURATION_HEADER()