[CMake] Values of CMAKE_BUILD_TYPE from toolchain file are ignored
[WebKit-https.git] / CMakeLists.txt
index 706e1b3..05b0579 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)