[CMake] WebCore derived sources should only be referenced inside WebCore
[WebKit-https.git] / Source / WebCore / WebCoreMacros.cmake
index 9ca32bd..93a449f 100644 (file)
@@ -2,15 +2,15 @@ macro(MAKE_HASH_TOOLS _source)
     get_filename_component(_name ${_source} NAME_WE)
 
     if (${_source} STREQUAL "DocTypeStrings")
-        set(_hash_tools_h "${DERIVED_SOURCES_WEBCORE_DIR}/HashTools.h")
+        set(_hash_tools_h "${WebCore_DERIVED_SOURCES_DIR}/HashTools.h")
     else ()
         set(_hash_tools_h "")
     endif ()
 
     add_custom_command(
-        OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}.cpp ${_hash_tools_h}
+        OUTPUT ${WebCore_DERIVED_SOURCES_DIR}/${_name}.cpp ${_hash_tools_h}
         MAIN_DEPENDENCY ${_source}.gperf
-        COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/make-hash-tools.pl ${DERIVED_SOURCES_WEBCORE_DIR} ${_source}.gperf ${GPERF_EXECUTABLE}
+        COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/make-hash-tools.pl ${WebCore_DERIVED_SOURCES_DIR} ${_source}.gperf ${GPERF_EXECUTABLE}
         VERBATIM)
 
     unset(_name)
@@ -19,12 +19,12 @@ endmacro()
 
 
 # Append the given dependencies to the source file
-# This one consider the given dependencies are in ${DERIVED_SOURCES_WEBCORE_DIR}
+# This one consider the given dependencies are in ${WebCore_DERIVED_SOURCES_DIR}
 # and prepends this to every member of dependencies list
 macro(ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES _source _deps)
     set(_tmp "")
     foreach (f ${_deps})
-        list(APPEND _tmp "${DERIVED_SOURCES_WEBCORE_DIR}/${f}")
+        list(APPEND _tmp "${WebCore_DERIVED_SOURCES_DIR}/${f}")
     endforeach ()
 
     WEBKIT_ADD_SOURCE_DEPENDENCIES(${_source} ${_tmp})
@@ -148,26 +148,26 @@ endfunction()
 macro(GENERATE_FONT_NAMES _infile)
     set(NAMES_GENERATOR ${WEBCORE_DIR}/dom/make_names.pl)
     set(_arguments  --fonts ${_infile})
-    set(_outputfiles ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitFontFamilyNames.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitFontFamilyNames.h)
+    set(_outputfiles ${WebCore_DERIVED_SOURCES_DIR}/WebKitFontFamilyNames.cpp ${WebCore_DERIVED_SOURCES_DIR}/WebKitFontFamilyNames.h)
 
     add_custom_command(
         OUTPUT  ${_outputfiles}
         MAIN_DEPENDENCY ${_infile}
         DEPENDS ${MAKE_NAMES_DEPENDENCIES} ${NAMES_GENERATOR} ${SCRIPTS_BINDINGS}
-        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR} ${_arguments}
+        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --outputDir ${WebCore_DERIVED_SOURCES_DIR} ${_arguments}
         VERBATIM)
 endmacro()
 
 
 macro(GENERATE_EVENT_FACTORY _infile _namespace)
     set(NAMES_GENERATOR ${WEBCORE_DIR}/dom/make_event_factory.pl)
-    set(_outputfiles ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}Interfaces.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}Factory.cpp)
+    set(_outputfiles ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}Interfaces.h ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}Factory.cpp)
 
     add_custom_command(
         OUTPUT  ${_outputfiles}
         MAIN_DEPENDENCY ${_infile}
         DEPENDS ${NAMES_GENERATOR} ${SCRIPTS_BINDINGS}
-        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
+        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${WebCore_DERIVED_SOURCES_DIR}
         VERBATIM)
 endmacro()
 
@@ -179,10 +179,10 @@ macro(GENERATE_SETTINGS_MACROS _infile _outfile)
     # build in parallel or the two instances of the rule may conflict.
     # <https://cmake.org/cmake/help/v3.0/command/add_custom_command.html>
     set(_extra_output
-        ${DERIVED_SOURCES_WEBCORE_DIR}/Settings.cpp
-        ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.h
-        ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.cpp
-        ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl
+        ${WebCore_DERIVED_SOURCES_DIR}/Settings.cpp
+        ${WebCore_DERIVED_SOURCES_DIR}/InternalSettingsGenerated.h
+        ${WebCore_DERIVED_SOURCES_DIR}/InternalSettingsGenerated.cpp
+        ${WebCore_DERIVED_SOURCES_DIR}/InternalSettingsGenerated.idl
     )
 
     set(GENERATE_SETTINGS_SCRIPTS
@@ -195,10 +195,10 @@ macro(GENERATE_SETTINGS_MACROS _infile _outfile)
 
     set(_args BYPRODUCTS ${_extra_output})
     add_custom_command(
-        OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_outfile}
+        OUTPUT ${WebCore_DERIVED_SOURCES_DIR}/${_outfile}
         MAIN_DEPENDENCY ${_infile}
         DEPENDS ${NAMES_GENERATOR} ${GENERATE_SETTINGS_SCRIPTS} ${SCRIPTS_BINDINGS}
-        COMMAND ${RUBY_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${DERIVED_SOURCES_WEBCORE_DIR}
+        COMMAND ${RUBY_EXECUTABLE} ${NAMES_GENERATOR} --input ${_infile} --outputDir ${WebCore_DERIVED_SOURCES_DIR}
         VERBATIM ${_args})
 endmacro()
 
@@ -206,7 +206,7 @@ endmacro()
 macro(GENERATE_DOM_NAMES _namespace _attrs)
     set(NAMES_GENERATOR ${WEBCORE_DIR}/dom/make_names.pl)
     set(_arguments  --attrs ${_attrs})
-    set(_outputfiles ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}Names.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}Names.h)
+    set(_outputfiles ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}Names.cpp ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}Names.h)
     set(_extradef)
     set(_tags)
 
@@ -220,7 +220,7 @@ macro(GENERATE_DOM_NAMES _namespace _attrs)
 
     if (_tags)
         set(_arguments "${_arguments}" --tags ${_tags} --factory --wrapperFactory)
-        set(_outputfiles "${_outputfiles}" ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementFactory.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_namespace}ElementTypeHelpers.h ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/JS${_namespace}ElementWrapperFactory.h)
+        set(_outputfiles "${_outputfiles}" ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}ElementFactory.cpp ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}ElementFactory.h ${WebCore_DERIVED_SOURCES_DIR}/${_namespace}ElementTypeHelpers.h ${WebCore_DERIVED_SOURCES_DIR}/JS${_namespace}ElementWrapperFactory.cpp ${WebCore_DERIVED_SOURCES_DIR}/JS${_namespace}ElementWrapperFactory.h)
     endif ()
 
     if (_extradef)
@@ -230,6 +230,6 @@ macro(GENERATE_DOM_NAMES _namespace _attrs)
     add_custom_command(
         OUTPUT  ${_outputfiles}
         DEPENDS ${MAKE_NAMES_DEPENDENCIES} ${NAMES_GENERATOR} ${SCRIPTS_BINDINGS} ${_attrs} ${_tags}
-        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --preprocessor "${CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS}" --outputDir ${DERIVED_SOURCES_WEBCORE_DIR} ${_arguments} ${_additionArguments}
+        COMMAND ${PERL_EXECUTABLE} ${NAMES_GENERATOR} --preprocessor "${CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS}" --outputDir ${WebCore_DERIVED_SOURCES_DIR} ${_arguments} ${_additionArguments}
         VERBATIM)
 endmacro()