Reviewed by eseidel.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Sep 2006 08:23:26 +0000 (08:23 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Sep 2006 08:23:26 +0000 (08:23 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=10901
        Merge build fixes from unity

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

WebCore/CMakeLists.txt
WebCore/ChangeLog

index 5764ec92906aecdf9cd4d01abacf1203273eb9af..469791037e8f15a58656ff407e5530fdaec850e8 100644 (file)
@@ -325,19 +325,55 @@ create_lut(WebCore-unity_LIB_SRCS bindings/js/kjs_navigator.cpp kjs_navigator.lu
 create_lut(WebCore-unity_LIB_SRCS bindings/js/kjs_traversal.cpp kjs_traversal.lut.h bindings/js/kjs_traversal.cpp)
 create_lut(WebCore-unity_LIB_SRCS bindings/js/JSXMLHttpRequest.cpp JSXMLHttpRequest.lut.h bindings/js/JSXMLHttpRequest.cpp)
 create_lut(WebCore-unity_LIB_SRCS bindings/js/JSXSLTProcessor.cpp JSXSLTProcessor.lut.h bindings/js/JSXSLTProcessor.cpp)
-create_cpp_lut(bindings/js/JSHTMLInputElementBase.cpp JSHTMLInputElementBaseTable.cpp bindings/js/JSHTMLInputElementBase.cpp)
+
+# now this is ugly
+# WebKit sources include some generated files which have the suffix ".cpp"
+# the CMake way to create the dependencies of targets to generated files is
+# to list the generated files as part of the sources for the target.
+# If this would be done for the generated-and-then-included cpp-files
+# they would be compiled twice (once included and once on their own).
+# The easy way would be to rename the generated files to use the suffix
+# ".inl" or something like this. But this is not wanted by the WebKit developers
+# AFAIK. So we have to work around it here. This is done by renaming the
+# generated files to *.inl and adding these files to the list of sources
+# (WebCore-unity_LIB_SRCS). But the include-statements still want a cpp-file,
+# so tell CMake to create these cpp-files at cmake-time, but these files contain
+# nothing except an include-statement for the inl-file. Alex
+macro(CREATE_GENERATED_CPP_HELPER  _inlName)
+   get_filename_component(_baseName ${_inlName} NAME_WE)
+   if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp)
+      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp
+"/* This file is autogenerated by CMake.                                       *
+ * Do not edit, changes will be lost.                                         *
+ * With the CMake buildsystem giving generated-but-not-compiled-on-their-own  *
+ * files the suffix \".cpp\" is not recommended, because it breaks the          *
+ * dependency handling. So the actual generated file has the suffix \".inl\"    *
+ * and this file here only exists as a helper.                                */
+#include \"${CMAKE_CURRENT_BINARY_DIR}/${_inlName}\"\n")
+   endif (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.cpp)
+   set(WebCore-unity_LIB_SRCS ${WebCore-unity_LIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_inlName})
+endmacro(CREATE_GENERATED_CPP_HELPER  _inlName)
+
+
+create_cpp_lut(bindings/js/JSHTMLInputElementBase.cpp JSHTMLInputElementBaseTable.inl bindings/js/JSHTMLInputElementBase.cpp)
+create_generated_cpp_helper(JSHTMLInputElementBaseTable.inl)
+
 
 IF (WEBKIT_USE_SVG_SUPPORT)
-    create_cpp_lut(ksvg2/bindings/js/JSSVGNumber.cpp JSSVGNumberTable.cpp ksvg2/bindings/js/JSSVGNumber.cpp)
-    create_cpp_lut(ksvg2/bindings/js/JSSVGPoint.cpp JSSVGPointTable.cpp ksvg2/bindings/js/JSSVGPoint.cpp)
-    create_cpp_lut(ksvg2/bindings/js/JSSVGRect.cpp JSSVGRectTable.cpp ksvg2/bindings/js/JSSVGRect.cpp)
-ENDIF (WEBKIT_USE_SVG_SUPPORT)
 
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.cpp
-  COMMAND flex -t < ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex | perl ${CMAKE_CURRENT_SOURCE_DIR}/css/maketokenizer > ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.cpp
+    create_cpp_lut(ksvg2/bindings/js/JSSVGNumber.cpp JSSVGNumberTable.inl ksvg2/bindings/js/JSSVGNumber.cpp)
+    create_cpp_lut(ksvg2/bindings/js/JSSVGPoint.cpp JSSVGPointTable.inl ksvg2/bindings/js/JSSVGPoint.cpp)
+    create_generated_cpp_helper(JSSVGPointTable.inl)
+    create_cpp_lut(ksvg2/bindings/js/JSSVGRect.cpp JSSVGRectTable.inl ksvg2/bindings/js/JSSVGRect.cpp)
+    create_generated_cpp_helper(JSSVGRectTable.inl)
+
+ENDIF (WEBKIT_USE_SVG_SUPPORT)
 
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.inl
+  COMMAND flex -t < ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex | perl ${CMAKE_CURRENT_SOURCE_DIR}/css/maketokenizer > ${CMAKE_CURRENT_BINARY_DIR}/tokenizer.inl
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/css/tokenizer.flex
 )
+create_generated_cpp_helper(tokenizer.inl)
 
 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/CSSPropertyNames.h ${CMAKE_CURRENT_BINARY_DIR}/CSSPropertyNames.c
 
index 4eeafb22d7a86ae9ff5414e60d3edb36fad32810..8c819653e52d16046163c9d17366883d8121d512 100644 (file)
@@ -1,3 +1,12 @@
+2006-09-22  Rob Buis  <buis@kd.org>
+
+        Reviewed by eseidel.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=10901
+        Merge build fixes from unity
+
+        * CMakeLists.txt:
+
 2006-09-21  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by eseidel.