Standardize terminology for marked text
[WebKit-https.git] / CMakeLists.txt
index 58e5232..3fb3dd5 100644 (file)
@@ -1,8 +1,17 @@
 # -----------------------------------------------------------------------------
 # Determine CMake version and build type.
 # -----------------------------------------------------------------------------
+#
+# NOTE: cmake_minimum_required() and project() *MUST* be the two fist commands
+# used, see https://cmake.org/cmake/help/v3.3/command/project.html -- the
+# latter in particular handles loading a bunch of shared CMake definitions
+# and loading the cross-compilation settings from CMAKE_TOOLCHAIN_FILE.
+#
+
 cmake_minimum_required(VERSION 3.3)
 
+project(WebKit)
+
 if (NOT CMAKE_BUILD_TYPE)
     message(WARNING "No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.")
     set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
@@ -10,8 +19,6 @@ else ()
     message(STATUS "The CMake build type is: ${CMAKE_BUILD_TYPE}")
 endif ()
 
-project(WebKit)
-
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
 
 set(ENABLE_WEBCORE ON)
@@ -80,12 +87,8 @@ if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
     set(WTF_CPU_ARM 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
     set(WTF_CPU_ARM64 1)
-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "alpha*")
-    set(WTF_CPU_ALPHA 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
     set(WTF_CPU_MIPS 1)
-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "sh4")
-    set(WTF_CPU_SH4 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x64|x86_64|amd64)")
     set(WTF_CPU_X86_64 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
@@ -96,14 +99,8 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
     set(WTF_CPU_PPC64 1)
 elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
     set(WTF_CPU_PPC64LE 1)
-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "parisc*")
-    set(WTF_CPU_HPPA 1)
-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390")
-    set(WTF_CPU_S390 1)
-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
-    set(WTF_CPU_S390X 1)
 else ()
-    message(FATAL_ERROR "Unknown CPU '${LOWERCASE_CMAKE_SYSTEM_PROCESSOR}'")
+    set(WTF_CPU_UNKNOWN 1)
 endif ()
 
 # -----------------------------------------------------------------------------
@@ -124,17 +121,13 @@ endif ()
 # -----------------------------------------------------------------------------
 # Default library types
 # -----------------------------------------------------------------------------
-option(SHARED_CORE "build WebCore as a shared library")
-
-if (SHARED_CORE)
-    set(WebCore_LIBRARY_TYPE SHARED)
-else ()
-    set(WebCore_LIBRARY_TYPE STATIC)
-endif ()
-
+# By default, only the highest-level libraries, WebKitLegacy and WebKit, are
+# shared, because properly building shared libraries that depend on each other
+# can be tricky. Override these in Options*.cmake for your port as needed.
 set(WTF_LIBRARY_TYPE STATIC)
-set(JavaScriptCore_LIBRARY_TYPE SHARED)
+set(JavaScriptCore_LIBRARY_TYPE STATIC)
 set(PAL_LIBRARY_TYPE STATIC)
+set(WebCore_LIBRARY_TYPE STATIC)
 set(WebKitLegacy_LIBRARY_TYPE SHARED)
 set(WebKit_LIBRARY_TYPE SHARED)
 set(WebCoreTestSupport_LIBRARY_TYPE STATIC)
@@ -177,7 +170,13 @@ if (ENABLE_TOOLS)
     add_subdirectory(Tools)
 endif ()
 
-add_subdirectory(PerformanceTests)
+if ("${PORT}" STREQUAL "GTK" OR "${PORT}" STREQUAL "WPE")
+    if (DEVELOPER_MODE)
+        add_subdirectory(PerformanceTests)
+    endif ()
+else ()
+    add_subdirectory(PerformanceTests)
+endif ()
 
 # -----------------------------------------------------------------------------
 # Print the features list last, for maximum visibility.