Progress towards cmake on Windows.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Aug 2014 19:19:14 +0000 (19:19 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Aug 2014 19:19:14 +0000 (19:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135484

Reviewed by Martin Robinson.

.:
* CMakeLists.txt:
Added Mac to list of ports, even though it is not done yet.
Changed minimum bison version to version installed on Macs.
* Source/cmake/OptionsAppleWin.cmake:
Added some definitions.
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:
Set WTF_LIBRARY_TYPE to STATIC to not change WTF linking on EFL or GTK ports.
* Source/cmake/OptionsMac.cmake: Added blank for now.
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/OptionsWindows.cmake:
Added some definitions.
Removed /WX (warnings treated as error while compiling).
Copied warnings to ignore from WebKitLibraries/win/tools/vsprops/common.props.

Source/JavaScriptCore:
* CMakeLists.txt:
Generate code directly to inspector directory to avoid using the cp command
which is not available on Windows.
* PlatformWin.cmake: Added.

Source/WTF:
* wtf/CMakeLists.txt:
Added WTF_LIBRARY_TYPE because Windows needs WTF to be a shared library.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
CMakeLists.txt
ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformWin.cmake [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/wtf/CMakeLists.txt
Source/cmake/OptionsAppleWin.cmake
Source/cmake/OptionsEfl.cmake
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsMac.cmake [new file with mode: 0644]
Source/cmake/OptionsWinCairo.cmake
Source/cmake/OptionsWindows.cmake

index 99669d1..6388b1f 100644 (file)
@@ -41,7 +41,7 @@ include(WebKitFeatures)
 # -----------------------------------------------------------------------------
 # Determine which port will be built
 # -----------------------------------------------------------------------------
-set(ALL_PORTS Efl WinCE GTK AppleWin WinCairo)
+set(ALL_PORTS Efl WinCE GTK AppleWin WinCairo Mac)
 set(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
 
 list(FIND ALL_PORTS ${PORT} RET)
@@ -54,7 +54,7 @@ string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
 # -----------------------------------------------------------------------------
 # Find common packages (used by all ports)
 # -----------------------------------------------------------------------------
-find_package(BISON 2.4.1 REQUIRED)
+find_package(BISON 2.3 REQUIRED)
 find_package(FLEX 2.5.34 REQUIRED)
 
 # TODO Enforce version requirement for gperf
index db55af7..5880a27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2014-08-01  Alex Christensen  <achristensen@webkit.org>
+
+        Progress towards cmake on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=135484
+
+        Reviewed by Martin Robinson.
+
+        * CMakeLists.txt:
+        Added Mac to list of ports, even though it is not done yet.
+        Changed minimum bison version to version installed on Macs.
+        * Source/cmake/OptionsAppleWin.cmake:
+        Added some definitions.
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmake/OptionsGTK.cmake:
+        Set WTF_LIBRARY_TYPE to STATIC to not change WTF linking on EFL or GTK ports.
+        * Source/cmake/OptionsMac.cmake: Added blank for now.
+        * Source/cmake/OptionsWinCairo.cmake:
+        * Source/cmake/OptionsWindows.cmake:
+        Added some definitions.
+        Removed /WX (warnings treated as error while compiling).
+        Copied warnings to ignore from WebKitLibraries/win/tools/vsprops/common.props.
+
 2014-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [CMake] GTK and EFL are using PROJECT_VERSION_PATCH to define the micro version
index 5859b70..47b6001 100644 (file)
@@ -27,6 +27,7 @@ set(JavaScriptCore_INCLUDE_DIRECTORIES
     "${JAVASCRIPTCORE_DIR}/yarr"
     "${WTF_DIR}"
     "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
+    "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector"
     "${CMAKE_SOURCE_DIR}/Source"
     ${ICU_INCLUDE_DIRS}
 )
@@ -872,18 +873,19 @@ add_custom_command(
 
 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
 add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.cpp
-           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h
-           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.cpp
-           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h
-           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.cpp
-           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
+    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.cpp
+           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.h
+           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.cpp
+           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.h
+           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.cpp
+           ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
            ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorJSBackendCommands.js
     MAIN_DEPENDENCY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json
     DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py
             ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py
-    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_cpp_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_js_dir "${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol" --output_type JavaScript --write_always && mkdir -p ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector && cp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector
+    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}" --output_cpp_dir "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector" --output_js_dir "${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol" --output_type JavaScript --write_always
     VERBATIM)
+file(MAKE_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector)
 
 # JSCBuiltins
 file(GLOB JSCBuiltins_js_files "${CMAKE_CURRENT_SOURCE_DIR}/builtins/*.js")
@@ -895,16 +897,16 @@ add_custom_command(
    VERBATIM)
 
 list(APPEND JavaScriptCore_SOURCES
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.cpp
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.cpp
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.cpp
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.cpp
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.cpp
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.cpp
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
 )
 
 list(APPEND JavaScriptCore_HEADERS
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSBackendDispatchers.h
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSFrontendDispatchers.h
-    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSBackendDispatchers.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSFrontendDispatchers.h
+    ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/inspector/InspectorJSTypeBuilders.h
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
 )
 
index eeee65a..e4ed1f6 100644 (file)
@@ -1,3 +1,15 @@
+2014-08-01  Alex Christensen  <achristensen@webkit.org>
+
+        Progress towards cmake on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=135484
+
+        Reviewed by Martin Robinson.
+
+        * CMakeLists.txt:
+        Generate code directly to inspector directory to avoid using the cp command
+        which is not available on Windows.
+        * PlatformWin.cmake: Added.
+
 2014-07-31  Andreas Kling  <akling@apple.com>
 
         Remove the JSC::OverridesVisitChildren flag.
diff --git a/Source/JavaScriptCore/PlatformWin.cmake b/Source/JavaScriptCore/PlatformWin.cmake
new file mode 100644 (file)
index 0000000..318f618
--- /dev/null
@@ -0,0 +1,25 @@
+list(APPEND JavaScriptCore_SOURCES
+    API/JSStringRefBSTR.cpp
+    API/JSStringRefCF.cpp
+)
+
+if (WTF_PLATFORM_WIN_CAIRO)
+    list(APPEND JavaScriptCore_LIBRARIES
+        CFLite
+    )
+else ()
+    list(APPEND JavaScriptCore_LIBRARIES
+        CoreFoundation
+    )
+endif ()
+
+if (MSVC AND "${JavaScriptCore_LIBRARY_TYPE}" MATCHES "SHARED")
+    get_property(WTF_LIBRARY_LOCATION TARGET WTF PROPERTY LOCATION)
+
+    add_custom_command(
+        OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
+        DEPENDS WTF
+        COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/Scripts/generate-win32-export-forwards ${WTF_LIBRARY_LOCATION} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp
+        VERBATIM)
+    list(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/forwarded-exports.cpp)
+endif ()
\ No newline at end of file
index 8f4f915..db728a3 100644 (file)
@@ -1,3 +1,13 @@
+2014-07-31  Alex Christensen  <achristensen@webkit.org>
+
+        Progress towards cmake on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=135484
+
+        Reviewed by Martin Robinson.
+
+        * wtf/CMakeLists.txt:
+        Added WTF_LIBRARY_TYPE because Windows needs WTF to be a shared library.
+
 2014-07-30  Andreas Kling  <akling@apple.com>
 
         PropertyName's internal string is always atomic.
index ad12913..aee2806 100644 (file)
@@ -255,7 +255,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
 include_directories(${WTF_INCLUDE_DIRECTORIES})
-add_library(WTF STATIC ${WTF_HEADERS} ${WTF_SOURCES})
+add_library(WTF ${WTF_LIBRARY_TYPE} ${WTF_HEADERS} ${WTF_SOURCES})
 target_link_libraries(WTF ${WTF_LIBRARIES})
 set_target_properties(WTF PROPERTIES COMPILE_DEFINITIONS "BUILDING_WTF")
 set_target_properties(WTF PROPERTIES FOLDER "JavaScriptCore")
index c45b5d0..4dce6dd 100644 (file)
@@ -1,3 +1,6 @@
 include(OptionsWindows)
 
-set(PORT_FALLBACK Win)
+set(WTF_USE_CG 1)
+set(WTF_USE_CA 1)
+set(WTF_USE_CFNETWORK 1)
+set(WTF_USE_ICU_UNICODE 1)
index bbdb30e..1d1ff4f 100644 (file)
@@ -34,6 +34,7 @@ add_definitions(-DWTF_USE_SOUP=1)
 add_definitions(-DWTF_USE_CAIRO=1)
 add_definitions(-DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1)
 
+set(WTF_LIBRARY_TYPE STATIC)
 set(WTF_OUTPUT_NAME wtf_efl)
 set(JavaScriptCore_OUTPUT_NAME javascriptcore_efl)
 set(WebCore_OUTPUT_NAME webcore_efl)
index 277372b..ca4e5d1 100644 (file)
@@ -174,6 +174,7 @@ set(GTK_API_VERSION 3.0)
 set(WTF_USE_SOUP 1)
 set(WTF_USE_UDIS86 1)
 
+set(WTF_LIBRARY_TYPE STATIC)
 set(WTF_OUTPUT_NAME WTFGTK)
 set(JavaScriptCore_OUTPUT_NAME javascriptcoregtk-${WEBKITGTK_API_VERSION})
 set(WebCore_OUTPUT_NAME WebCoreGTK)
diff --git a/Source/cmake/OptionsMac.cmake b/Source/cmake/OptionsMac.cmake
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
index c45b5d0..af8e176 100644 (file)
@@ -1,3 +1,6 @@
 include(OptionsWindows)
 
-set(PORT_FALLBACK Win)
+set(WTF_PLATFORM_WIN_CAIRO 1)
+set(WTF_USE_CF 1)
+set(WTF_USE_CURL 1)
+set(WTF_USE_ICU_UNICODE 1)
index 023f36c..d2763dd 100644 (file)
@@ -4,10 +4,14 @@ WEBKIT_OPTION_BEGIN()
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC ON)
 WEBKIT_OPTION_END()
 
+include_directories("$ENV{WEBKIT_LIBRARIES}/include")
+link_directories("$ENV{WEBKIT_LIBRARIES}/lib$(PlatformArchitecture)")
 if (MSVC)
-    add_definitions(/WX
-        /wd4018 /wd4065 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4180 /wd4189 /wd4201 /wd4244 /wd4251 /wd4275 /wd4288 /wd4291
-        /wd4305 /wd4344 /wd4355 /wd4389 /wd4396 /wd4503 /wd4505 /wd4510 /wd4512 /wd4610 /wd4706 /wd4800 /wd4951 /wd4952 /wd4996)
+    add_definitions(
+        /wd4018 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4146 /wd4180 /wd4189 /wd4201 /wd4244 /wd4251 /wd4267 /wd4275 /wd4288
+        /wd4291 /wd4305 /wd4309 /wd4344 /wd4355 /wd4389 /wd4396 /wd4481 /wd4503 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4702
+        /wd4706 /wd4800 /wd4819 /wd4951 /wd4952 /wd4996 /wd6011 /wd6031 /wd6211 /wd6246 /wd6255 /wd6387
+    )
 
     string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable C++ exceptions
     string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Disable RTTI
@@ -17,3 +21,8 @@ if (MSVC)
         set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}")
     endif ()
 endif ()
+
+set(PORT_FALLBACK Win)
+set(JavaScriptCore_LIBRARY_TYPE SHARED)
+set(WTF_LIBRARY_TYPE SHARED)
+set(ICU_LIBRARIES libicuuc$(DebugSuffix) libicuin$(DebugSuffix))