Nix upstreaming - Adding build files and supporting scripts
[WebKit-https.git] / Source / CMakeLists.txt
1 # -----------------------------------------------------------------------------
2 # Add module directories
3 # -----------------------------------------------------------------------------
4 add_subdirectory(WTF)
5
6 add_subdirectory(JavaScriptCore)
7
8 if ("${PORT}" STREQUAL "Nix")
9     add_subdirectory(Platform)
10 endif ()
11
12 if (ENABLE_API_TESTS)
13     add_subdirectory(cmake/gtest)
14 endif ()
15
16 if (ENABLE_WEBCORE)
17     add_subdirectory(WebCore)
18 endif ()
19
20 if (ENABLE_WEBKIT)
21     add_subdirectory(WebKit)
22 endif ()
23
24 if (ENABLE_WEBKIT2)
25     add_subdirectory(WebKit2)
26 endif ()
27
28 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
29
30 # -----------------------------------------------------------------------------
31 # Set compiler flags for all targets
32 # -----------------------------------------------------------------------------
33 if ("${PORT}" STREQUAL "Nix")
34     if (NOT DISABLE_STRICT_BUILD)
35         set(ADDITIONAL_FLAGS ENABLE_WERROR)
36     endif ()
37     WEBKIT_SET_EXTRA_COMPILER_FLAGS(Platform ${ADDITIONAL_FLAGS})
38 endif ()
39
40 if (${PORT} STREQUAL "Efl")
41     set(ADDITIONAL_FLAGS ENABLE_WERROR)
42 endif ()
43
44 WEBKIT_SET_EXTRA_COMPILER_FLAGS(WTF ${ADDITIONAL_FLAGS})
45 WEBKIT_SET_EXTRA_COMPILER_FLAGS(JavaScriptCore ${ADDITIONAL_FLAGS})
46
47 if (ENABLE_WEBCORE)
48     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCoreTestSupport ${ADDITIONAL_FLAGS})
49     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCore ${ADDITIONAL_FLAGS})
50 endif ()
51
52 if (ENABLE_WEBKIT)
53     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebKit ${ADDITIONAL_FLAGS})
54 endif ()
55
56 if (ENABLE_WEBKIT2)
57     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebKit2 ${ADDITIONAL_FLAGS})
58 endif ()
59
60 # -----------------------------------------------------------------------------
61 # Create the configuration file
62 # -----------------------------------------------------------------------------
63 configure_file(cmakeconfig.h.cmake ${CMAKE_BINARY_DIR}/cmakeconfig.h @ONLY)