.: [CMake] Do not use JAVASCRIPTCORE_DIR in add_custom_command() of JavaScriptcore...
authorparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 23:45:40 +0000 (23:45 +0000)
committerparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2013 23:45:40 +0000 (23:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114265

Reviewed by Brent Fulgham.

* Source/cmake/WebKitMacros.cmake: Removed macro GENERATE_HASH_LUT.

Source/JavaScriptCore: [CMake] Do not use JAVASCRIPTCORE_DIR in add_custom_command() of JavaScriptCore project
https://bugs.webkit.org/show_bug.cgi?id=114265

Reviewed by Brent Fulgham.

Use CMAKE_CURRENT_SOURCE_DIR instead, since it provides the same value and is more
understandable. Also move the GENERATE_HASH_LUT macro into the CMakeLists.txt
of JavaScriptCore to avoid the usage of JAVASCRIPTCORE_DIR there too.

* CMakeLists.txt:

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

ChangeLog
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/cmake/WebKitMacros.cmake

index 1fe7b10..4515d03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-04-16  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Do not use JAVASCRIPTCORE_DIR in add_custom_command() of JavaScriptcore project
+        https://bugs.webkit.org/show_bug.cgi?id=114265
+
+        Reviewed by Brent Fulgham.
+
+        * Source/cmake/WebKitMacros.cmake: Removed macro GENERATE_HASH_LUT.
+
 2013-04-16  Andy Estes  <aestes@apple.com>
 
         Changed the default debugger from GDB to LLDB for the 'All Source' scheme in WebKit.xcworkspace.
index 9213715..faa02f5 100644 (file)
@@ -435,11 +435,20 @@ if (ENABLE_LLINT)
     )
 endif ()
 
+set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
+macro(GENERATE_HASH_LUT _input _output)
+    add_custom_command(
+        OUTPUT ${_output}
+        DEPENDS ${HASH_LUT_GENERATOR} ${_input}
+        COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
+        VERBATIM)
+    list(APPEND JavaScriptCore_HEADERS ${_output})
+endmacro()
+
 # GENERATOR 1-A: LUT creator
 foreach (_file ${JavaScriptCore_LUT_FILES})
     get_filename_component(_name ${_file} NAME_WE)
-    GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
-    list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
+    GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/${_file} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/${_name}.lut.h)
 endforeach ()
 
 set(JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES
@@ -482,25 +491,24 @@ set(JavaScriptCore_FORWARDING_HEADERS_FILES
 
 
 # GENERATOR 1-B: particular LUT creator (for 1 file only)
-GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h MAIN_DEPENDENCY)
-list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
+GENERATE_HASH_LUT(${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Lexer.lut.h)
 
 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
-    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/create_regex_tables
-    COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
+    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_regex_tables > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h
     VERBATIM)
-ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
+ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/yarr/YarrPattern.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/RegExpJitTables.h)
 
 
 #GENERATOR: "KeywordLookup.h": keyword decision tree used by the lexer
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
-    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py
-    COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/KeywordLookupGenerator.py ${JAVASCRIPTCORE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
+    MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/KeywordLookupGenerator.py ${CMAKE_CURRENT_SOURCE_DIR}/parser/Keywords.table > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h
     VERBATIM)
-ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
+ADD_SOURCE_DEPENDENCIES(${CMAKE_CURRENT_SOURCE_DIR}/parser/Lexer.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/KeywordLookup.h)
 
 if (WTF_CPU_ARM)
     list(APPEND JavaScriptCore_SOURCES
index 20648e4..d5af2ad 100644 (file)
@@ -1,3 +1,16 @@
+2013-04-16  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Do not use JAVASCRIPTCORE_DIR in add_custom_command() of JavaScriptCore project
+        https://bugs.webkit.org/show_bug.cgi?id=114265
+
+        Reviewed by Brent Fulgham.
+
+        Use CMAKE_CURRENT_SOURCE_DIR instead, since it provides the same value and is more
+        understandable. Also move the GENERATE_HASH_LUT macro into the CMakeLists.txt
+        of JavaScriptCore to avoid the usage of JAVASCRIPTCORE_DIR there too.
+
+        * CMakeLists.txt:
+
 2013-04-16  Anders Carlsson  <andersca@apple.com>
 
         Another Windows build fix attempt.
index 60c57f7..b5ecffd 100644 (file)
@@ -140,26 +140,6 @@ macro(GENERATE_DOM_NAMES _namespace _attrs)
 endmacro()
 
 
-# - Create hash table *.lut.h
-# GENERATE_HASH_LUT(input_file output_file)
-macro(GENERATE_HASH_LUT _input _output)
-    set(HASH_LUT_GENERATOR "${JAVASCRIPTCORE_DIR}/create_hash_table")
-
-    foreach (_tmp ${ARGN})
-        if (${_tmp} STREQUAL "MAIN_DEPENDENCY")
-            set(_main_dependency ${_input})
-        endif ()
-    endforeach ()
-
-    add_custom_command(
-        OUTPUT ${_output}
-        MAIN_DEPENDENCY ${_main_dependency}
-        DEPENDS ${_input} ${HASH_LUT_GENERATOR}
-        COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
-        VERBATIM)
-endmacro()
-
-
 macro(GENERATE_GRAMMAR _prefix _input _output_header _output_source _features)
     # This is a workaround for winflexbison, which does not work corretly when
     # run in a different working directory than the installation directory.