undefined reference to JSC::IdentifierTable::~IdentifierTable() on EFL port
[WebKit-https.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
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 OPTION(ONLY_BUILD_JAVASCRIPTCORE "only build JavaScriptCore")
23 IF (ONLY_BUILD_JAVASCRIPTCORE)
24     SET(ENABLE_WEBCORE OFF)
25     SET(ENABLE_WEBKIT OFF)
26     SET(ENABLE_WEBKIT2 OFF)
27     SET(ENABLE_TOOLS OFF)
28 ENDIF ()
29
30 SET(JAVASCRIPTCORE_DIR "${CMAKE_SOURCE_DIR}/Source/JavaScriptCore")
31 SET(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
32 SET(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit")
33 SET(WEBKIT2_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit2")
34 SET(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/Source/ThirdParty")
35
36 SET(TOOLS_DIR "${CMAKE_SOURCE_DIR}/Tools")
37
38 SET(DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources")
39 SET(DERIVED_SOURCES_JAVASCRIPTCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore")
40 SET(DERIVED_SOURCES_WEBCORE_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebCore")
41 SET(DERIVED_SOURCES_WEBKIT2_DIR "${CMAKE_BINARY_DIR}/DerivedSources/WebKit2")
42
43 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
44
45 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
46 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
47 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
48
49 # Do not create transitive library dependencies by default
50 SET(CMAKE_LINK_INTERFACE_LIBRARIES "")
51
52 INCLUDE(WebKitMacros)
53 INCLUDE(WebKitFS)
54 INCLUDE(WebKitHelpers)
55 INCLUDE(WebKitFeatures)
56
57 # -----------------------------------------------------------------------------
58 # Determine which port will be built
59 # -----------------------------------------------------------------------------
60 SET(ALL_PORTS Efl WinCE BlackBerry)
61 SET(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
62
63 LIST(FIND ALL_PORTS ${PORT} RET)
64 IF (${RET} EQUAL -1)
65     MESSAGE(FATAL_ERROR "Please choose which WebKit port to build (one of ${ALL_PORTS})")
66 ENDIF ()
67
68 STRING(TOLOWER ${PORT} WEBKIT_PORT_DIR)
69
70 # -----------------------------------------------------------------------------
71 # Find common packages (used by all ports)
72 # -----------------------------------------------------------------------------
73 FIND_PACKAGE(BISON REQUIRED)
74 FIND_PACKAGE(FLEX REQUIRED)
75 FIND_PACKAGE(Gperf REQUIRED)
76 FIND_PACKAGE(Perl REQUIRED)
77 FIND_PACKAGE(PythonInterp REQUIRED)
78
79 # -----------------------------------------------------------------------------
80 # Determine the target processor
81 # -----------------------------------------------------------------------------
82 STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
83 IF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
84     SET(WTF_CPU_ARM 1)
85 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
86     SET(WTF_CPU_MIPS 1)
87 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
88     SET(WTF_CPU_X86_64 1)
89 ELSEIF (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
90     SET(WTF_CPU_X86 1)
91 ELSE ()
92     MESSAGE(FATAL_ERROR "Unknown CPU '${CMAKE_SYSTEM_PROCESSOR}'")
93 ENDIF ()
94
95 # -----------------------------------------------------------------------------
96 # Determine the operating system
97 # -----------------------------------------------------------------------------
98 IF (UNIX)
99     IF (APPLE)
100         SET(WTF_OS_MAC_OS_X 1)
101     ELSE ()
102         SET(WTF_OS_UNIX 1)
103     ENDIF ()
104 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
105     SET(WTF_OS_WINDOWS 1)
106 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "QNX")
107     SET(WTF_OS_QNX 1)
108     SET(WTF_OS_UNIX 1)
109 ELSE ()
110     MESSAGE(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'")
111 ENDIF ()
112
113 # -----------------------------------------------------------------------------
114 # Default target names (can be overrriden in Options${PORT}.cmake file)
115 # -----------------------------------------------------------------------------
116 SET(JSC_EXECUTABLE_NAME JSC)
117 SET(WTF_LIBRARY_NAME WTF)
118 SET(JavaScriptCore_LIBRARY_NAME JavaScriptCore)
119 SET(WebCore_LIBRARY_NAME WebCore)
120 SET(WebKit_LIBRARY_NAME WebKit)
121 SET(WebKit2_LIBRARY_NAME WebKit2)
122 SET(WebCoreTestSupport_LIBRARY_NAME WebCoreTestSupport)
123
124 # -----------------------------------------------------------------------------
125 # Default library types
126 # -----------------------------------------------------------------------------
127 OPTION(SHARED_CORE "build JavaScriptCore and WebCore as shared libraries")
128
129 IF (SHARED_CORE)
130     SET(JavaScriptCore_LIBRARY_TYPE SHARED)
131     SET(WebCore_LIBRARY_TYPE SHARED)
132 ELSE ()
133     SET(JavaScriptCore_LIBRARY_TYPE STATIC)
134     SET(WebCore_LIBRARY_TYPE STATIC)
135 ENDIF ()
136
137 SET(WebKit_LIBRARY_TYPE SHARED)
138 SET(WebKit2_LIBRARY_TYPE SHARED)
139 SET(WebCoreTestSupport_LIBRARY_TYPE STATIC)
140
141 # -----------------------------------------------------------------------------
142 # Port-specific options
143 # -----------------------------------------------------------------------------
144 INCLUDE(OptionsCommon)
145 INCLUDE(Options${PORT})
146
147 # -----------------------------------------------------------------------------
148 # Install JavaScript shell
149 # -----------------------------------------------------------------------------
150 OPTION(SHOULD_INSTALL_JS_SHELL "generate an installation rule to install the built JavaScript shell")
151
152 # -----------------------------------------------------------------------------
153 # Define packaging
154 # -----------------------------------------------------------------------------
155 INCLUDE(WebKitPackaging)
156
157 # -----------------------------------------------------------------------------
158 # Add module directories
159 # -----------------------------------------------------------------------------
160 ADD_SUBDIRECTORY(Source)
161
162 # -----------------------------------------------------------------------------
163 # Add tools
164 # -----------------------------------------------------------------------------
165 IF (ENABLE_TOOLS)
166     ADD_SUBDIRECTORY(Tools)
167 ENDIF ()
168
169 # -----------------------------------------------------------------------------
170 # Prints a summary of all enabled/disabled features
171 # -----------------------------------------------------------------------------
172 WEBKIT_PRINT_FEATURES()