[CMake][EFL] Enable the LLInt
[WebKit-https.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
2 PROJECT(WebKit)
3
4 # Set a default build type if and only if user did not define one as command
5 # line options and he did not give custom CFLAGS or CXXFLAGS. Otherwise, flags
6 # from default build type would overwrite user-defined ones.
7 IF (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS AND NOT CMAKE_CXX_FLAGS)
8     SET(CMAKE_BUILD_TYPE Release)
9 ENDIF ()
10
11 # -----------------------------------------------------------------------------
12 # Default library type
13 # -----------------------------------------------------------------------------
14 SET(ENABLE_WEBCORE ON)
15
16 IF (NOT ENABLE_WEBKIT AND NOT ENABLE_WEBKIT2)
17     SET(ENABLE_WEBKIT ON)
18 ENDIF ()
19
20 SET(ENABLE_TOOLS ON)
21
22 SET(WTF_DIR "${CMAKE_SOURCE_DIR}/Source/WTF")
23 SET(JAVASCRIPTCORE_DIR "${CMAKE_SOURCE_DIR}/Source/JavaScriptCore")
24 SET(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
25 SET(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit")
26 SET(WEBKIT2_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit2")
27 SET(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/Source/ThirdParty")
28
29 SET(TOOLS_DIR "${CMAKE_SOURCE_DIR}/Tools")
30
31 SET(DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources")
32 SET(DERIVED_SOURCES_JAVASCRIPTCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore")
33 SET(DERIVED_SOURCES_WEBCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebCore")
34 SET(DERIVED_SOURCES_WEBKIT_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit")
35 SET(DERIVED_SOURCES_WEBKIT2_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit2")
36
37 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
38
39 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
40 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
41 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
42
43 INCLUDE(WebKitMacros)
44 INCLUDE(WebKitFS)
45 INCLUDE(WebKitHelpers)
46 INCLUDE(WebKitFeatures)
47
48 # -----------------------------------------------------------------------------
49 # Determine which port will be built
50 # -----------------------------------------------------------------------------
51 SET(ALL_PORTS Efl WinCE BlackBerry)
52 SET(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
53
54 LIST(FIND ALL_PORTS ${PORT} RET)
55 IF (${RET} EQUAL -1)
56     MESSAGE(FATAL_ERROR "Please choose which WebKit port to build (one of ${ALL_PORTS})")
57 ENDIF ()
58
59 STRING(TOLOWER ${PORT} WEBKIT_PORT_DIR)
60
61 # -----------------------------------------------------------------------------
62 # Find common packages (used by all ports)
63 # -----------------------------------------------------------------------------
64 FIND_PACKAGE(BISON REQUIRED)
65 FIND_PACKAGE(FLEX REQUIRED)
66 FIND_PACKAGE(Gperf REQUIRED)
67 FIND_PACKAGE(Perl REQUIRED)
68 FIND_PACKAGE(PythonInterp REQUIRED)
69 FIND_PACKAGE(Ruby)
70
71 # -----------------------------------------------------------------------------
72 # Determine the target processor
73 # -----------------------------------------------------------------------------
74 STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
75 IF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
76     SET(WTF_CPU_ARM 1)
77 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
78     SET(WTF_CPU_MIPS 1)
79 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
80     SET(WTF_CPU_X86_64 1)
81 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
82     SET(WTF_CPU_X86 1)
83 ELSE ()
84     MESSAGE(FATAL_ERROR "Unknown CPU '${CMAKE_SYSTEM_PROCESSOR}'")
85 ENDIF ()
86
87 # -----------------------------------------------------------------------------
88 # Determine the operating system
89 # -----------------------------------------------------------------------------
90 IF (UNIX)
91     IF (APPLE)
92         SET(WTF_OS_MAC_OS_X 1)
93     ELSE ()
94         SET(WTF_OS_UNIX 1)
95     ENDIF ()
96 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
97     SET(WTF_OS_WINDOWS 1)
98 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "QNX")
99     SET(WTF_OS_QNX 1)
100     SET(WTF_OS_UNIX 1)
101 ELSE ()
102     MESSAGE(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'")
103 ENDIF ()
104
105 # -----------------------------------------------------------------------------
106 # Default target names (can be overrriden in Options${PORT}.cmake file)
107 # -----------------------------------------------------------------------------
108 SET(JSC_EXECUTABLE_NAME JSC)
109 SET(WTF_LIBRARY_NAME WTF)
110 SET(JavaScriptCore_LIBRARY_NAME JavaScriptCore)
111 SET(WebCore_LIBRARY_NAME WebCore)
112 SET(WebKit_LIBRARY_NAME WebKit)
113 SET(WebKit2_LIBRARY_NAME WebKit2)
114 SET(WebCoreTestSupport_LIBRARY_NAME WebCoreTestSupport)
115
116 # -----------------------------------------------------------------------------
117 # Default library types
118 # -----------------------------------------------------------------------------
119 OPTION(SHARED_CORE "build JavaScriptCore and WebCore as shared libraries")
120
121 IF (SHARED_CORE)
122     SET(JavaScriptCore_LIBRARY_TYPE SHARED)
123     SET(WebCore_LIBRARY_TYPE SHARED)
124 ELSE ()
125     SET(JavaScriptCore_LIBRARY_TYPE STATIC)
126     SET(WebCore_LIBRARY_TYPE STATIC)
127 ENDIF ()
128
129 SET(WebKit_LIBRARY_TYPE SHARED)
130 SET(WebKit2_LIBRARY_TYPE SHARED)
131 SET(WebCoreTestSupport_LIBRARY_TYPE STATIC)
132
133 # -----------------------------------------------------------------------------
134 # Port-specific options
135 # -----------------------------------------------------------------------------
136 INCLUDE(OptionsCommon)
137 INCLUDE(Options${PORT})
138
139 # -----------------------------------------------------------------------------
140 # Enable API unit tests and create a target for the test runner
141 # -----------------------------------------------------------------------------
142 IF (ENABLE_API_TESTS)
143     ENABLE_TESTING()
144 ENDIF ()
145
146 # -----------------------------------------------------------------------------
147 # Install JavaScript shell
148 # -----------------------------------------------------------------------------
149 OPTION(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the built JavaScript shell")
150
151 # -----------------------------------------------------------------------------
152 # Define packaging
153 # -----------------------------------------------------------------------------
154 INCLUDE(WebKitPackaging)
155
156 # -----------------------------------------------------------------------------
157 # Add module directories
158 # -----------------------------------------------------------------------------
159 ADD_SUBDIRECTORY(Source)
160
161 # -----------------------------------------------------------------------------
162 # Add tools
163 # -----------------------------------------------------------------------------
164 IF (ENABLE_TOOLS)
165     ADD_SUBDIRECTORY(Tools)
166 ENDIF ()
167