diff options
143 files changed, 4670 insertions, 2498 deletions
diff --git a/.gitattributes b/.gitattributes index d959918..3829160 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,13 @@ .gitattributes export-ignore .hooks* export-ignore +# Custom attribute to mark sources as using our C code style. +[attr]our-c-style whitespace=tab-in-indent format.clang-format + +# Custom attribute to mark sources as generated. +# Do not perform whitespace checks. Do not format. +[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format + bootstrap crlf=input configure crlf=input *.[1-9] crlf=input @@ -16,10 +23,17 @@ configure crlf=input *.sln -crlf *.vcproj -crlf -*.c whitespace=tab-in-indent -*.h whitespace=tab-in-indent -*.cxx whitespace=tab-in-indent -*.txt whitespace=tab-in-indent -*.cmake whitespace=tab-in-indent +*.c our-c-style +*.cc our-c-style +*.cpp our-c-style +*.cu our-c-style +*.cxx our-c-style +*.h our-c-style +*.hh our-c-style +*.hpp our-c-style +*.hxx our-c-style +*.notcu our-c-style +*.cmake whitespace=tab-in-indent *.rst whitespace=tab-in-indent conflict-marker-size=79 +*.txt whitespace=tab-in-indent diff --git a/Auxiliary/cmake.m4 b/Auxiliary/cmake.m4 index 3ef4c16..7beff41 100644 --- a/Auxiliary/cmake.m4 +++ b/Auxiliary/cmake.m4 @@ -24,10 +24,10 @@ AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])d failed=false AC_MSG_CHECKING([for $1]) -if test -n "$1[]_$2[]FLAGS"; then +if test -z "${$1[]_$2[]FLAGS}"; then $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true fi -if test -n "$1[]_LIBS"; then +if test -z "${$1[]_LIBS}"; then $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true fi diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index ba0b30f..27b5d30 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -329,11 +329,17 @@ For example: To support legacy CMake code, unquoted arguments may also contain double-quoted strings (``"..."``, possibly enclosing horizontal whitespace), and make-style variable references (``$(MAKEVAR)``). + Unescaped double-quotes must balance, may not appear at the beginning of an unquoted argument, and are treated as part of the content. For example, the unquoted arguments ``-Da="b c"``, ``-Da=$(v)``, and ``a" "b"c"d`` are each interpreted literally. + Make-style references are treated literally as part of the content + and do not undergo variable expansion. They are treated as part + of a single argument (rather than as separate ``$``, ``(``, + ``MAKEVAR``, and ``)`` arguments). + The above "unquoted_legacy" production represents such arguments. We do not recommend using legacy unquoted arguments in new code. Instead use a `Quoted Argument`_ or a `Bracket Argument`_ to diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst index 56d4ca7..e9da396 100644 --- a/Help/manual/cmake-qt.7.rst +++ b/Help/manual/cmake-qt.7.rst @@ -63,20 +63,24 @@ If a ``Q_OBJECT`` or ``Q_GADGET`` macro is found in a header file, ``moc`` will be run on the file. The result will be put into a file named according to ``moc_<basename>.cpp``. If the macro is found in a C++ implementation file, the moc output will be put into a file named according to -``<basename>.moc``, following the Qt conventions. The ``moc file`` may be -included by the user in the C++ implementation file with a preprocessor -``#include``. If it is not so included, it will be added to a separate file -which is compiled into the target. +``<basename>.moc``, following the Qt conventions. The ``<basename>.moc`` must +be included by the user in the C++ implementation file with a preprocessor +``#include``. -The ``moc`` command line will consume the :prop_tgt:`COMPILE_DEFINITIONS` and -:prop_tgt:`INCLUDE_DIRECTORIES` target properties from the target it is being -invoked for, and for the appropriate build configuration. - -The generated ``moc_*.cpp`` and ``*.moc`` files are placed in the +Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. (This differs from CMake 3.7 and below; see their documentation for details.) +Not included ``moc_<basename>.cpp`` files will be generated in custom +folders to avoid name collisions and included in a separate +``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/moc_compilation.cpp`` +file which is compiled into the target. + +The ``moc`` command line will consume the :prop_tgt:`COMPILE_DEFINITIONS` and +:prop_tgt:`INCLUDE_DIRECTORIES` target properties from the target it is being +invoked for, and for the appropriate build configuration. + The :prop_tgt:`AUTOMOC` target property may be pre-set for all following targets by setting the :variable:`CMAKE_AUTOMOC` variable. The :prop_tgt:`AUTOMOC_MOC_OPTIONS` target property may be populated to set diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst index b42643f..4ac9b6e 100644 --- a/Help/prop_tgt/AUTOMOC.rst +++ b/Help/prop_tgt/AUTOMOC.rst @@ -8,31 +8,41 @@ preprocessor automatically, i.e. without having to use the :module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are supported. -When this property is set ``ON``, CMake will scan the +When this property is set ``ON``, CMake will scan the header and source files at build time and invoke moc accordingly. -* If an ``#include`` statement like ``#include "moc_foo.cpp"`` is found, - the ``Q_OBJECT`` class declaration is expected in the header, and - ``moc`` is run on the header file. A ``moc_foo.cpp`` file will be - generated from the source's header into the - ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` - directory which is automatically added to the target's +* If an ``#include`` statement like ``#include "moc_<basename>.cpp"`` is found, + the ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in an otherwise empty + line of the ``<basename>.h(xx)`` header file. ``moc`` is run on the header file to + generate ``moc_<basename>.cpp`` in the + ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory + which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. This allows the compiler to find the - included ``moc_foo.cpp`` file regardless of the location the original source. - However, if multiple source files in different directories do this then their - generated moc files would collide. In this case a diagnostic will be issued. - -* If an ``#include`` statement like ``#include "foo.moc"`` is found, - then a ``Q_OBJECT`` is expected in the current source file and ``moc`` - is run on the file itself. Additionally, header files with the same - base name (like ``foo.h``) or ``_p`` appended to the base name (like - ``foo_p.h``) are parsed for ``Q_OBJECT`` macros, and if found, ``moc`` - is also executed on those files. ``AUTOMOC`` checks multiple header - alternative extensions, such as ``hpp``, ``hxx`` etc when searching - for headers. The resulting moc files, which are not included as shown - above in any of the source files are included in a generated - ``moc_compilation.cpp`` file, which is compiled as part of the - target. + included ``moc_<basename>.cpp`` file regardless of the location the + original source. + +* If an ``#include`` statement like ``#include "<basename>.moc"`` is found, + then ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in the current source + file and ``moc`` is run on the source file itself. + +* Header files that are not included by an ``#include "moc_<basename>.cpp"`` + statement are nonetheless scanned for ``Q_OBJECT`` or ``Q_GADGET`` macros. + The resulting ``moc_<basename>.cpp`` files are generated in custom + directories and automatically included in the generated + ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/moc_compilation.cpp`` file, + which is compiled as part of the target. The custom directories help to + avoid name collisions for moc files with the same ``<basename>``. + +* Additionally, header files with the same base name as a source file, + (like ``<basename>.h``) or ``_p`` appended to the base name (like + ``<basename>_p.h``), are parsed for ``Q_OBJECT`` or ``Q_GADGET`` macros, + and if found, ``moc`` is also executed on those files. + +* ``AUTOMOC`` always checks multiple header alternative extensions, + such as ``hpp``, ``hxx``, etc. when searching for headers. + +* ``AUTOMOC`` looks for the ``Q_PLUGIN_METADATA`` macro and reruns the + ``moc`` when the file addressed by the ``FILE`` argument of the macro changes. This property is initialized by the value of the :variable:`CMAKE_AUTOMOC` variable if it is set when a target is created. diff --git a/Help/release/dev/Autogen_json.rst b/Help/release/dev/Autogen_json.rst new file mode 100644 index 0000000..73bbdf1 --- /dev/null +++ b/Help/release/dev/Autogen_json.rst @@ -0,0 +1,10 @@ +AutoGen json +------------ + +* When using :prop_tgt:`AUTOMOC`, CMake scans for the presence of the + ``Q_PLUGIN_METADATA`` macro and reruns moc when the file from the + macro's ``FILE`` argument changes. + +* When :prop_tgt:`AUTOMOC` detects an include statement of the form + ``#include "moc_<basename>.cpp"`` the respective header file is searched + for in the :prop_tgt:`INCLUDE_DIRECTORIES` of the target as well. diff --git a/Help/release/dev/productbuild_component_plist.rst b/Help/release/dev/productbuild_component_plist.rst new file mode 100644 index 0000000..78d305c --- /dev/null +++ b/Help/release/dev/productbuild_component_plist.rst @@ -0,0 +1,7 @@ +productbuild_component_plist +---------------------------- + +* The :module:`CPackComponent` module :command:`cpack_add_component` command + gained a new ``PLIST <filename>`` option to specify the ``pkgbuild`` + ``--component-plist`` argument when using the + :module:`productbuild <CPackProductBuild>` generator. diff --git a/Help/release/dev/productbuild_resources.rst b/Help/release/dev/productbuild_resources.rst new file mode 100644 index 0000000..f381e63 --- /dev/null +++ b/Help/release/dev/productbuild_resources.rst @@ -0,0 +1,7 @@ +productbuild_resources +---------------------- + +* The :module:`CPackProductBuild` module gained a new + :variable:`CPACK_PRODUCTBUILD_RESOURCES_DIR` variable to + specify resources to be copied into the ``Resources`` + directory. diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in index 3fafaff..b647ecf 100644 --- a/Modules/AutogenInfo.cmake.in +++ b/Modules/AutogenInfo.cmake.in @@ -1,25 +1,31 @@ -set(AM_SOURCES @_moc_uic_sources@) -set(AM_HEADERS @_moc_uic_headers@) -set(AM_SKIP_MOC @_skip_moc@) -set(AM_SKIP_UIC @_skip_uic@) -set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) -set(AM_MOC_INCLUDES @_moc_incs@) -set(AM_MOC_OPTIONS @_moc_options@) -set(AM_MOC_RELAXED_MODE "@_moc_relaxed_mode@") -set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") +# Target names +set(AM_TARGET_NAME @_autogen_target_name@) +set(AM_ORIGIN_TARGET_NAME @_origin_target_name@) +# Directories and files set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") -set(AM_QT_MOC_EXECUTABLE "@_qt_moc_executable@") -set(AM_QT_UIC_EXECUTABLE "@_qt_uic_executable@") -set(AM_QT_RCC_EXECUTABLE "@_qt_rcc_executable@") set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/") set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/") -set(AM_QT_VERSION_MAJOR "@_target_qt_version@") -set(AM_TARGET_NAME @_moc_target_name@) -set(AM_ORIGIN_TARGET_NAME @_origin_target_name@) +set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") +set(AM_SOURCES @_sources@) +set(AM_HEADERS @_headers@) +# Qt environment +set(AM_QT_VERSION_MAJOR @_qt_version_major@) +set(AM_QT_MOC_EXECUTABLE @_qt_moc_executable@) +set(AM_QT_UIC_EXECUTABLE @_qt_uic_executable@) +set(AM_QT_RCC_EXECUTABLE @_qt_rcc_executable@) +# MOC settings +set(AM_MOC_SKIP @_moc_skip@) +set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) +set(AM_MOC_INCLUDES @_moc_incs@) +set(AM_MOC_OPTIONS @_moc_options@) +set(AM_MOC_RELAXED_MODE @_moc_relaxed_mode@) +# UIC settings +set(AM_UIC_SKIP @_uic_skip@) set(AM_UIC_TARGET_OPTIONS @_uic_target_options@) set(AM_UIC_OPTIONS_FILES @_qt_uic_options_files@) set(AM_UIC_OPTIONS_OPTIONS @_qt_uic_options_options@) +# RCC settings set(AM_RCC_SOURCES @_rcc_files@ ) set(AM_RCC_INPUTS @_rcc_inputs@) set(AM_RCC_OPTIONS_FILES @_rcc_options_files@) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 8675553..f34ec5d 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -35,10 +35,9 @@ if(CMAKE_HOST_UNIX) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) if(CMAKE_UNAME) - exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME) - exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$") - exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR + exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "Power Macintosh") @@ -49,10 +48,10 @@ if(CMAKE_HOST_UNIX) exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) else() - exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR + exec_program(${CMAKE_UNAME} ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) if("${val}" GREATER 0) - exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR + exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) endif() endif() @@ -67,7 +66,6 @@ if(CMAKE_HOST_UNIX) endif() else() if(CMAKE_HOST_WIN32) - set (CMAKE_HOST_SYSTEM_NAME "Windows") if (DEFINED ENV{PROCESSOR_ARCHITEW6432}) set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") else() diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake index 188dde3..395a268 100644 --- a/Modules/CPackComponent.cmake +++ b/Modules/CPackComponent.cmake @@ -105,7 +105,8 @@ # [DEPENDS comp1 comp2 ... ] # [INSTALL_TYPES type1 type2 ... ] # [DOWNLOADED] -# [ARCHIVE_FILE filename]) +# [ARCHIVE_FILE filename] +# [PLIST filename]) # # # @@ -163,6 +164,9 @@ # a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of # the component. See cpack_configure_downloads for more information. # +# PLIST gives a filename that is passed to pkgbuild with the +# ``--component-plist`` argument when using the productbuild generator. +# # .. command:: cpack_add_component_group # # Describes a group of related CPack installation components. @@ -389,7 +393,7 @@ endmacro() macro(cpack_add_component compname) string(TOUPPER ${compname} _CPACK_ADDCOMP_UNAME) cpack_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME} - "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE" + "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE;PLIST" "HIDDEN;REQUIRED;DISABLED;DOWNLOADED" ${ARGN} ) @@ -445,6 +449,9 @@ macro(cpack_add_component compname) cpack_append_option_set_command( CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_DOWNLOADED _CPACK_ADDCOMP_STR) + cpack_append_string_variable_set_command( + CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_PLIST + _CPACK_ADDCOMP_STR) # Backward compatibility issue. # Write to config iff the macros is used after CPack.cmake has been # included, other it's not necessary because the variables diff --git a/Modules/CPackProductBuild.cmake b/Modules/CPackProductBuild.cmake index d545d3e..4779b95 100644 --- a/Modules/CPackProductBuild.cmake +++ b/Modules/CPackProductBuild.cmake @@ -46,3 +46,11 @@ # # Specify a specific keychain to search for the signing identity. # +# +# .. variable:: CPACK_PRODUCTBUILD_RESOURCES_DIR +# +# If specified the productbuild generator copies files from this directory +# (including subdirectories) to the ``Resources`` directory. This is done +# before the :variable:`CPACK_RESOURCE_FILE_WELCOME`, +# :variable:`CPACK_RESOURCE_FILE_README`, and +# :variable:`CPACK_RESOURCE_FILE_LICENSE` files are copied. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 458c114..c3fd3c6 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -174,9 +174,16 @@ Create custom targets to build projects in external trees Install step options are: ``INSTALL_DIR <dir>`` - Installation prefix + Installation prefix to be placed in the ``<INSTALL_DIR>`` placeholder. + This does not actually configure the external project to install to + the given prefix. That must be done by passing appropriate arguments + to the external project configuration step, e.g. using ``<INSTALL_DIR>``. ``INSTALL_COMMAND <cmd>...`` - Command to drive install after build + Command to drive installation of the external project after it has been + built. This only happens at the *build* time of the calling project. + In order to install files from the external project alongside the + locally-built files, a separate local :command:`install` call must be + added to pick the files up from one of the external project trees. Test step options are: diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index a96a8ca..8fb44d8 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -112,6 +112,7 @@ function(CUDA_SELECT_NVCC_ARCH_FLAGS out_variable) list(REMOVE_DUPLICATES CUDA_ARCH_LIST) foreach(arch_name ${CUDA_ARCH_LIST}) set(arch_bin) + set(arch_ptx) set(add_ptx FALSE) # Check to see if we are compiling PTX if(arch_name MATCHES "(.*)\\+PTX$") diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 6747be5..20d7924 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -223,7 +223,10 @@ function(_GTK2_SIGCXX_GET_VERSION _OUT_major _OUT_minor _OUT_micro _sigcxxversio set(${_OUT_minor} ${${_OUT_minor}} PARENT_SCOPE) set(${_OUT_micro} ${${_OUT_micro}} PARENT_SCOPE) else() - message(FATAL_ERROR "Include file ${_gtkversion_hdr} does not exist") + # The header does not have the version macros; assume it is ``0.0.0``. + set(${_OUT_major} 0) + set(${_OUT_minor} 0) + set(${_OUT_micro} 0) endif() endfunction() diff --git a/Source/.gitattributes b/Source/.gitattributes index dbd6382..1cec8a3 100644 --- a/Source/.gitattributes +++ b/Source/.gitattributes @@ -1,10 +1,21 @@ -# Preserve indentation style in generated code. -cmCommandArgumentLexer.cxx whitespace=-tab-in-indent,-indent-with-non-tab -cmCommandArgumentLexer.h whitespace=-tab-in-indent,-indent-with-non-tab -cmDependsJavaLexer.cxx whitespace=-tab-in-indent,-indent-with-non-tab -cmDependsJavaLexer.h whitespace=-tab-in-indent,-indent-with-non-tab -cmExprLexer.cxx whitespace=-tab-in-indent,-indent-with-non-tab -cmExprLexer.h whitespace=-tab-in-indent,-indent-with-non-tab -cmFortranLexer.cxx whitespace=-tab-in-indent,-indent-with-non-tab -cmFortranLexer.h whitespace=-tab-in-indent,-indent-with-non-tab -cmListFileLexer.c whitespace=-tab-in-indent,-indent-with-non-tab +/cmCommandArgumentLexer.cxx generated +/cmCommandArgumentLexer.h generated +/cmCommandArgumentParser.cxx generated +/cmCommandArgumentParserTokens.h generated +/cmDependsJavaLexer.cxx generated +/cmDependsJavaLexer.h generated +/cmDependsJavaParser.cxx generated +/cmDependsJavaParserTokens.h generated +/cmExprLexer.cxx generated +/cmExprLexer.h generated +/cmExprParser.cxx generated +/cmExprParserTokens.h generated +/cmFortranLexer.cxx generated +/cmFortranLexer.h generated +/cmFortranParser.cxx generated +/cmFortranParserTokens.h generated +/cmListFileLexer.c generated + +# Do not format third-party sources. +/bindexplib.* -format.clang-format +/kwsys/** -format.clang-format diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5dda9d0..12dc033 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 8) -set(CMake_VERSION_PATCH 20170220) +set(CMake_VERSION_PATCH 20170224) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackComponentGroup.h b/Source/CPack/cmCPackComponentGroup.h index f955daf..510adc2 100644 --- a/Source/CPack/cmCPackComponentGroup.h +++ b/Source/CPack/cmCPackComponentGroup.h @@ -78,6 +78,10 @@ public: /// contains the files that are part of this component. std::string ArchiveFile; + /// The file to pass to --component-plist when using the + /// productbuild generator. + std::string Plist; + /// The components that this component depends on. std::vector<cmCPackComponent*> Dependencies; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 21eda79..e1a4a2a 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1396,6 +1396,11 @@ cmCPackComponent* cmCPackGenerator::GetComponent( component->ArchiveFile = archiveFile; } + const char* plist = this->GetOption(macroPrefix + "_PLIST"); + if (plist && *plist) { + component->Plist = plist; + } + const char* groupName = this->GetOption(macroPrefix + "_GROUP"); if (groupName && *groupName) { component->Group = GetComponentGroup(projectName, groupName); diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 5354fca..57b8fff 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -13,7 +13,6 @@ #include "cmCPackComponentGroup.h" #include "cmSystemTools.h" -class cmCPackGenerator; class cmCPackLog; class cmInstalledFile; class cmMakefile; diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index a5a18dc..1389eaa 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -59,12 +59,25 @@ int cmCPackProductBuildGenerator::PackageFiles() } } - // Copy or create all of the resource files we need. std::string resDir = packageDirFileName + "/Contents"; + + if (this->IsSet("CPACK_PRODUCTBUILD_RESOURCES_DIR")) { + std::string userResDir = + this->GetOption("CPACK_PRODUCTBUILD_RESOURCES_DIR"); + + if (!cmSystemTools::CopyADirectory(userResDir, resDir)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" + << std::endl); + return 0; + } + } + + // Copy or create all of the resource files we need. if (!this->CopyCreateResourceFile("License", resDir) || !this->CopyCreateResourceFile("ReadMe", resDir) || !this->CopyCreateResourceFile("Welcome", resDir)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the resource files" + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem copying the License, ReadMe and Welcome files" << std::endl); return 0; } @@ -223,6 +236,10 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( : " --keychain \"" + keychainPath + "\"") << " \"" << packageFile << "\""; + if (component && !component->Plist.empty()) { + pkgCmd << " --component-plist \"" << component->Plist << "\""; + } + // Run ProductBuild return RunProductBuild(pkgCmd.str()); } diff --git a/Source/CursesDialog/form/.gitattributes b/Source/CursesDialog/form/.gitattributes new file mode 100644 index 0000000..62d728c --- /dev/null +++ b/Source/CursesDialog/form/.gitattributes @@ -0,0 +1 @@ +* -format.clang-format diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 12b69a8..93e5ca2 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -6,7 +6,6 @@ #include <cmsys/RegularExpression.hxx> #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 4d33458..ebdc8b0 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -14,7 +14,6 @@ #include <time.h> #include <vector> -class cmCTest; class cmCTestGenericHandler; class cmCTestStartCommand; class cmGeneratedFileStream; diff --git a/Source/cmCommandArgumentParser.cxx b/Source/cmCommandArgumentParser.cxx index 75191c8..4a7acfc 100644 --- a/Source/cmCommandArgumentParser.cxx +++ b/Source/cmCommandArgumentParser.cxx @@ -85,7 +85,9 @@ Modify cmCommandArgumentParser.cxx: */ -#include "cmStandardIncludes.h" +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string.h> #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner)) @@ -125,7 +127,7 @@ static void cmCommandArgument_yyerror(yyscan_t yyscanner, const char* message); # pragma warning (disable: 4702) /* unreachable code */ #endif -#line 129 "cmCommandArgumentParser.cxx" /* yacc.c:339 */ +#line 131 "cmCommandArgumentParser.cxx" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -198,7 +200,7 @@ int cmCommandArgument_yyparse (yyscan_t yyscanner); /* Copy the second part of user declarations. */ -#line 202 "cmCommandArgumentParser.cxx" /* yacc.c:358 */ +#line 204 "cmCommandArgumentParser.cxx" /* yacc.c:358 */ #ifdef short # undef short @@ -496,9 +498,9 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 94, 94, 100, 103, 108, 111, 116, 119, 124, - 127, 130, 133, 136, 139, 144, 147, 150, 153, 158, - 161, 166, 169, 174, 177 + 0, 96, 96, 102, 105, 110, 113, 118, 121, 126, + 129, 132, 135, 138, 141, 146, 149, 152, 155, 160, + 163, 168, 171, 176, 179 }; #endif @@ -1295,192 +1297,192 @@ yyreduce: switch (yyn) { case 2: -#line 94 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 96 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = 0; yyGetParser->SetResult((yyvsp[0].str)); } -#line 1304 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1306 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 3: -#line 100 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 102 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1312 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1314 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 4: -#line 103 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 105 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1320 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1322 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 5: -#line 108 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 110 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = 0; } -#line 1328 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1330 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 6: -#line 111 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 113 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1336 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1338 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 7: -#line 116 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 118 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1344 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1346 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 8: -#line 119 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 121 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1352 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1354 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 9: -#line 124 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 126 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1360 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1362 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 10: -#line 127 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 129 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1368 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1370 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 11: -#line 130 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 132 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1376 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1378 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 12: -#line 133 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 135 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1384 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1386 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 13: -#line 136 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 138 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1392 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1394 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 14: -#line 139 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 141 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1400 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1402 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 15: -#line 144 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 146 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1408 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1410 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 16: -#line 147 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 149 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str)); } -#line 1416 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1418 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 17: -#line 150 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 152 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str)); } -#line 1424 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1426 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 18: -#line 153 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 155 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str)); } -#line 1432 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1434 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 19: -#line 158 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 160 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1440 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1442 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 20: -#line 161 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 163 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[-1].str); } -#line 1448 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1450 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 21: -#line 166 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 168 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = 0; } -#line 1456 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1458 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 22: -#line 169 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 171 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str)); } -#line 1464 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1466 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 23: -#line 174 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 176 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1472 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1474 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; case 24: -#line 177 "cmCommandArgumentParser.y" /* yacc.c:1646 */ +#line 179 "cmCommandArgumentParser.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } -#line 1480 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1482 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ break; -#line 1484 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ +#line 1486 "cmCommandArgumentParser.cxx" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1710,7 +1712,7 @@ yyreturn: #endif return yyresult; } -#line 182 "cmCommandArgumentParser.y" /* yacc.c:1906 */ +#line 184 "cmCommandArgumentParser.y" /* yacc.c:1906 */ /* End of grammar */ diff --git a/Source/cmCommandArgumentParser.y b/Source/cmCommandArgumentParser.y index cfd76d1..d71b605 100644 --- a/Source/cmCommandArgumentParser.y +++ b/Source/cmCommandArgumentParser.y @@ -14,7 +14,9 @@ Modify cmCommandArgumentParser.cxx: */ -#include "cmStandardIncludes.h" +#include <cmConfigure.h> // IWYU pragma: keep + +#include <string.h> #define yyGetParser (cmCommandArgument_yyget_extra(yyscanner)) diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index 95bf0ad..5bfb236 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -8,27 +8,15 @@ #include <string> #include <vector> -#define YYSTYPE cmCommandArgumentParserHelper::ParserType -#define YYSTYPE_IS_DECLARED -#define YY_EXTRA_TYPE cmCommandArgumentParserHelper* -#define YY_DECL \ - int cmCommandArgument_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) - -/** \class cmCommandArgumentParserHelper - * \brief Helper class for parsing java source files - * - * Finds dependencies for java file and list of outputs - */ - class cmMakefile; class cmCommandArgumentParserHelper { public: - typedef struct + struct ParserType { char* str; - } ParserType; + }; cmCommandArgumentParserHelper(); ~cmCommandArgumentParserHelper(); @@ -100,4 +88,10 @@ private: bool RemoveEmpty; }; +#define YYSTYPE cmCommandArgumentParserHelper::ParserType +#define YYSTYPE_IS_DECLARED +#define YY_EXTRA_TYPE cmCommandArgumentParserHelper* +#define YY_DECL \ + int cmCommandArgument_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) + #endif diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index b58dc62..1576722 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -1,6 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCommands.h" +#include "cmPolicies.h" #include "cmState.h" #include "cmAddCustomCommandCommand.h" diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index ff9ffc0..fd9d04b 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -8,6 +8,7 @@ #include <sstream> #include <stdio.h> #include <string.h> +#include <utility> #include "cmAlgorithms.h" #include "cmExportTryCompileFileGenerator.h" diff --git a/Source/cmDependsJavaParser.cxx b/Source/cmDependsJavaParser.cxx index a1beb58..b09bd0c 100644 --- a/Source/cmDependsJavaParser.cxx +++ b/Source/cmDependsJavaParser.cxx @@ -85,6 +85,12 @@ Modify cmDependsJavaParser.cxx: */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <stdlib.h> +#include <string.h> +#include <string> + #define yyGetParser (cmDependsJava_yyget_extra(yyscanner)) /*-------------------------------------------------------------------------*/ @@ -110,7 +116,7 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message); # pragma warning (disable: 4065) /* Switch statement contains default but no case. */ #endif -#line 114 "cmDependsJavaParser.cxx" /* yacc.c:339 */ +#line 120 "cmDependsJavaParser.cxx" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -365,7 +371,7 @@ int cmDependsJava_yyparse (yyscan_t yyscanner); /* Copy the second part of user declarations. */ -#line 369 "cmDependsJavaParser.cxx" /* yacc.c:358 */ +#line 375 "cmDependsJavaParser.cxx" /* yacc.c:358 */ #ifdef short # undef short @@ -673,42 +679,42 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 173, 173, 182, 190, 198, 206, 214, 222, 231, - 239, 248, 256, 265, 270, 275, 280, 285, 290, 295, - 300, 306, 314, 323, 333, 342, 351, 359, 369, 375, - 382, 389, 395, 402, 411, 421, 431, 440, 448, 457, - 466, 472, 481, 487, 496, 502, 511, 523, 531, 540, - 552, 565, 573, 581, 590, 598, 607, 607, 607, 608, - 609, 609, 609, 609, 609, 609, 610, 613, 623, 632, - 641, 650, 660, 666, 675, 684, 693, 701, 710, 719, - 725, 734, 742, 750, 758, 767, 775, 784, 790, 798, - 807, 815, 824, 833, 842, 850, 859, 867, 875, 884, - 893, 903, 910, 920, 930, 937, 944, 947, 953, 963, - 973, 983, 989, 999, 1009, 1019, 1028, 1038, 1049, 1059, - 1066, 1076, 1085, 1095, 1104, 1114, 1120, 1130, 1139, 1149, - 1159, 1166, 1175, 1184, 1193, 1202, 1210, 1219, 1228, 1238, - 1248, 1257, 1267, 1277, 1284, 1293, 1303, 1312, 1322, 1331, - 1338, 1348, 1357, 1367, 1376, 1385, 1395, 1405, 1414, 1424, - 1433, 1442, 1451, 1460, 1469, 1479, 1488, 1497, 1506, 1515, - 1525, 1534, 1543, 1552, 1561, 1570, 1579, 1588, 1597, 1606, - 1615, 1624, 1634, 1644, 1655, 1665, 1675, 1684, 1693, 1702, - 1711, 1720, 1729, 1739, 1749, 1759, 1769, 1776, 1783, 1790, - 1800, 1807, 1817, 1827, 1836, 1846, 1855, 1865, 1872, 1879, - 1886, 1894, 1901, 1911, 1918, 1928, 1938, 1945, 1955, 1964, - 1974, 1984, 1993, 2003, 2012, 2022, 2033, 2040, 2047, 2058, - 2068, 2078, 2088, 2097, 2107, 2114, 2124, 2133, 2143, 2150, - 2160, 2169, 2179, 2188, 2194, 2203, 2212, 2221, 2230, 2240, - 2250, 2257, 2267, 2274, 2284, 2293, 2303, 2312, 2321, 2330, - 2340, 2347, 2357, 2366, 2376, 2386, 2392, 2399, 2409, 2419, - 2429, 2440, 2450, 2461, 2471, 2482, 2492, 2502, 2511, 2520, - 2529, 2538, 2548, 2558, 2568, 2577, 2586, 2595, 2604, 2614, - 2624, 2634, 2643, 2652, 2661, 2671, 2680, 2689, 2696, 2705, - 2714, 2723, 2733, 2742, 2751, 2761, 2770, 2779, 2788, 2798, - 2807, 2816, 2825, 2834, 2843, 2853, 2862, 2871, 2881, 2890, - 2900, 2909, 2919, 2928, 2938, 2947, 2957, 2966, 2976, 2985, - 2995, 3004, 3014, 3024, 3034, 3043, 3053, 3062, 3071, 3080, - 3089, 3098, 3107, 3116, 3125, 3134, 3143, 3152, 3162, 3172, - 3182, 3191 + 0, 179, 179, 188, 196, 204, 212, 220, 228, 237, + 245, 254, 262, 271, 276, 281, 286, 291, 296, 301, + 306, 312, 320, 329, 339, 348, 357, 365, 375, 381, + 388, 395, 401, 408, 417, 427, 437, 446, 454, 463, + 472, 478, 487, 493, 502, 508, 517, 529, 537, 546, + 558, 571, 579, 587, 596, 604, 613, 613, 613, 614, + 615, 615, 615, 615, 615, 615, 616, 619, 629, 638, + 647, 656, 666, 672, 681, 690, 699, 707, 716, 725, + 731, 740, 748, 756, 764, 773, 781, 790, 796, 804, + 813, 821, 830, 839, 848, 856, 865, 873, 881, 890, + 899, 909, 916, 926, 936, 943, 950, 953, 959, 969, + 979, 989, 995, 1005, 1015, 1025, 1034, 1044, 1055, 1065, + 1072, 1082, 1091, 1101, 1110, 1120, 1126, 1136, 1145, 1155, + 1165, 1172, 1181, 1190, 1199, 1208, 1216, 1225, 1234, 1244, + 1254, 1263, 1273, 1283, 1290, 1299, 1309, 1318, 1328, 1337, + 1344, 1354, 1363, 1373, 1382, 1391, 1401, 1411, 1420, 1430, + 1439, 1448, 1457, 1466, 1475, 1485, 1494, 1503, 1512, 1521, + 1531, 1540, 1549, 1558, 1567, 1576, 1585, 1594, 1603, 1612, + 1621, 1630, 1640, 1650, 1661, 1671, 1681, 1690, 1699, 1708, + 1717, 1726, 1735, 1745, 1755, 1765, 1775, 1782, 1789, 1796, + 1806, 1813, 1823, 1833, 1842, 1852, 1861, 1871, 1878, 1885, + 1892, 1900, 1907, 1917, 1924, 1934, 1944, 1951, 1961, 1970, + 1980, 1990, 1999, 2009, 2018, 2028, 2039, 2046, 2053, 2064, + 2074, 2084, 2094, 2103, 2113, 2120, 2130, 2139, 2149, 2156, + 2166, 2175, 2185, 2194, 2200, 2209, 2218, 2227, 2236, 2246, + 2256, 2263, 2273, 2280, 2290, 2299, 2309, 2318, 2327, 2336, + 2346, 2353, 2363, 2372, 2382, 2392, 2398, 2405, 2415, 2425, + 2435, 2446, 2456, 2467, 2477, 2488, 2498, 2508, 2517, 2526, + 2535, 2544, 2554, 2564, 2574, 2583, 2592, 2601, 2610, 2620, + 2630, 2640, 2649, 2658, 2667, 2677, 2686, 2695, 2702, 2711, + 2720, 2729, 2739, 2748, 2757, 2767, 2776, 2785, 2794, 2804, + 2813, 2822, 2831, 2840, 2849, 2859, 2868, 2877, 2887, 2896, + 2906, 2915, 2925, 2934, 2944, 2953, 2963, 2972, 2982, 2991, + 3001, 3010, 3020, 3030, 3040, 3049, 3059, 3068, 3077, 3086, + 3095, 3104, 3113, 3122, 3131, 3140, 3149, 3158, 3168, 3178, + 3188, 3197 }; #endif @@ -2276,214 +2282,214 @@ yyreduce: switch (yyn) { case 2: -#line 174 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 180 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2287 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2293 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 3: -#line 183 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 189 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2298 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2304 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 4: -#line 191 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 197 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2309 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2315 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 5: -#line 199 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 205 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2320 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2326 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 6: -#line 207 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 213 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2331 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2337 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 7: -#line 215 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 221 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2342 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2348 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 8: -#line 223 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 229 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2353 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2359 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 9: -#line 232 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 238 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2364 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2370 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 10: -#line 240 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 246 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2375 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2381 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 11: -#line 249 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 255 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2386 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2392 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 12: -#line 257 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 263 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2397 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2403 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 13: -#line 266 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 272 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2405 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2411 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 14: -#line 271 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 277 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2413 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2419 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 15: -#line 276 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 282 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2421 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2427 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 16: -#line 281 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 287 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2429 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2435 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 17: -#line 286 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 292 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2437 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2443 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 18: -#line 291 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 297 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2445 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2451 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 19: -#line 296 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 302 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2453 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2459 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 20: -#line 301 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 307 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); } -#line 2461 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2467 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 21: -#line 307 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 313 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2472 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2478 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 22: -#line 315 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 321 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2483 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2489 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 23: -#line 324 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 330 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpStoreClass((yyvsp[0].str)); @@ -2491,44 +2497,44 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2495 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2501 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 24: -#line 334 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 340 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2506 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2512 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 25: -#line 343 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 349 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2517 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2523 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 26: -#line 352 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 358 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2528 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2534 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 27: -#line 360 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 366 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpStoreClass((yyvsp[-1].str)); @@ -2536,56 +2542,56 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2540 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2546 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 28: -#line 370 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 376 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2549 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2555 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 29: -#line 376 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 382 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2558 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2564 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 30: -#line 383 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 389 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2567 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2573 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 31: -#line 390 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 396 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = (yyvsp[0].str); } -#line 2576 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2582 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 32: -#line 396 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 402 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); (yyval.str) = (yyvsp[0].str); } -#line 2585 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2591 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 33: -#line 403 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 409 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->AddClassFound((yyvsp[-2].str)); @@ -2593,11 +2599,11 @@ yyreduce: yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); (yyval.str) = const_cast<char*>(yyGetParser->GetCurrentCombine()); } -#line 2597 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2603 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 34: -#line 412 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 418 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2606,11 +2612,11 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2610 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2616 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 35: -#line 422 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 428 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -2619,118 +2625,118 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2623 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2629 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 36: -#line 432 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 438 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2634 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2640 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 37: -#line 441 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 447 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2645 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2651 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 38: -#line 449 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 455 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2656 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2662 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 39: -#line 458 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 464 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2667 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2673 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 40: -#line 466 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 472 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2677 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2683 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 41: -#line 473 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 479 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2688 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2694 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 42: -#line 481 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 487 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2698 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2704 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 43: -#line 488 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 494 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2709 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2715 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 44: -#line 496 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 502 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2719 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2725 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 45: -#line 503 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 509 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2730 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2736 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 46: -#line 512 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 518 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->SetCurrentPackage((yyvsp[-1].str)); @@ -2740,33 +2746,33 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2744 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2750 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 47: -#line 524 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 530 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2755 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2761 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 48: -#line 532 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 538 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2766 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2772 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 49: -#line 541 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 547 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->AddPackagesImport((yyvsp[-1].str)); @@ -2776,11 +2782,11 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2780 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2786 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 50: -#line 553 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 559 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); std::string str = (yyvsp[-3].str); @@ -2791,77 +2797,77 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2795 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2801 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 51: -#line 566 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 572 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2806 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2812 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 52: -#line 574 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 580 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2817 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2823 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 53: -#line 582 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 588 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2828 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2834 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 54: -#line 591 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 597 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2839 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2845 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 55: -#line 599 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 605 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2850 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2856 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 67: -#line 614 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 620 "cmDependsJavaParser.y" /* yacc.c:1646 */ { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 2861 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2867 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 68: -#line 624 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 630 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -2869,11 +2875,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2873 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2879 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 69: -#line 633 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 639 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(2); @@ -2881,11 +2887,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2885 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2891 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 70: -#line 642 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 648 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -2893,11 +2899,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2897 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2903 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 71: -#line 651 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 657 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -2905,226 +2911,226 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 2909 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2915 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 72: -#line 660 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 666 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2919 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2925 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 73: -#line 667 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 673 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2930 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2936 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 74: -#line 676 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 682 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2941 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2947 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 75: -#line 685 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 691 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2952 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2958 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 76: -#line 694 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 700 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2963 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2969 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 77: -#line 702 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 708 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2974 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2980 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 78: -#line 711 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 717 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2985 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 2991 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 79: -#line 719 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 725 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 2995 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3001 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 80: -#line 726 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 732 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3006 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3012 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 81: -#line 735 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 741 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3017 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3023 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 82: -#line 743 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 749 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3028 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3034 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 83: -#line 751 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 757 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3039 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3045 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 84: -#line 759 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 765 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3050 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3056 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 85: -#line 768 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 774 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3061 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3067 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 86: -#line 776 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 782 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3072 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3078 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 87: -#line 785 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 791 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); } -#line 3080 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3086 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 88: -#line 791 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 797 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3091 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3097 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 89: -#line 799 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 805 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3102 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3108 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 90: -#line 808 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 814 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3113 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3119 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 91: -#line 816 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 822 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3124 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3130 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 92: -#line 825 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 831 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -3132,77 +3138,77 @@ yyreduce: (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3136 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3142 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 93: -#line 834 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 840 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3147 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3153 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 94: -#line 843 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 849 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3158 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3164 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 95: -#line 851 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 857 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3169 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3175 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 96: -#line 860 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 866 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3180 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3186 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 97: -#line 868 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 874 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3191 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3197 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 98: -#line 876 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 882 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3202 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3208 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 99: -#line 885 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 891 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -3210,11 +3216,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3214 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3220 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 100: -#line 894 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 900 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -3222,22 +3228,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3226 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3232 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 101: -#line 903 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 909 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3237 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3243 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 102: -#line 911 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 917 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3245,11 +3251,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3249 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3255 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 103: -#line 921 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 927 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3258,40 +3264,40 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3262 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3268 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 104: -#line 931 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 937 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); } -#line 3271 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3277 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 105: -#line 937 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 943 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3282 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3288 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 107: -#line 948 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 954 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); } -#line 3291 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3297 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 108: -#line 954 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 960 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3299,11 +3305,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3303 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3309 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 109: -#line 964 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 970 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3311,11 +3317,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3315 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3321 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 110: -#line 974 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 980 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3323,20 +3329,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3327 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3333 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 111: -#line 984 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 990 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); } -#line 3336 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3342 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 112: -#line 990 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 996 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3344,11 +3350,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3348 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3354 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 113: -#line 1000 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1006 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3356,11 +3362,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3360 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3366 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 114: -#line 1010 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1016 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3368,11 +3374,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3372 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3378 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 115: -#line 1020 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1026 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -3380,11 +3386,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3384 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3390 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 116: -#line 1029 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1035 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -3392,11 +3398,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3396 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3402 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 117: -#line 1039 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1045 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -3405,11 +3411,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3409 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3415 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 118: -#line 1050 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1056 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -3417,22 +3423,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3421 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3427 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 119: -#line 1059 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1065 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3432 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3438 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 120: -#line 1067 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1073 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3440,11 +3446,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3444 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3450 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 121: -#line 1077 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1083 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -3452,11 +3458,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3456 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3462 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 122: -#line 1086 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1092 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -3464,22 +3470,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3468 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3474 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 123: -#line 1096 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1102 "cmDependsJavaParser.y" /* yacc.c:1646 */ { yyGetParser->StartClass((yyvsp[0].str)); jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); jpCheckEmpty(3); } -#line 3479 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3485 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 124: -#line 1105 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1111 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3487,21 +3493,21 @@ yyreduce: yyGetParser->SetCurrentCombine(""); yyGetParser->EndClass(); } -#line 3491 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3497 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 125: -#line 1114 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1120 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3501 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3507 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 126: -#line 1121 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1127 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3509,11 +3515,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3513 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3519 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 127: -#line 1131 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1137 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3521,11 +3527,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3525 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3531 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 128: -#line 1140 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1146 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3533,11 +3539,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3537 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3543 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 129: -#line 1150 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1156 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3545,33 +3551,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3549 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3555 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 130: -#line 1159 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1165 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3560 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3566 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 131: -#line 1167 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1173 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3571 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3577 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 132: -#line 1176 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1182 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3579,11 +3585,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3583 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3589 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 133: -#line 1185 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1191 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3591,11 +3597,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3595 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3601 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 134: -#line 1194 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1200 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3603,22 +3609,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3607 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3613 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 135: -#line 1203 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1209 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3618 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3624 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 136: -#line 1211 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1217 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3626,22 +3632,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3630 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3636 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 137: -#line 1220 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1226 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3641 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3647 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 138: -#line 1229 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1235 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3649,11 +3655,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3653 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3659 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 139: -#line 1239 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1245 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3661,11 +3667,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3665 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3671 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 140: -#line 1249 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1255 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3673,11 +3679,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3677 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3683 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 141: -#line 1258 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1264 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3685,11 +3691,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3689 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3695 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 142: -#line 1268 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1274 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3697,22 +3703,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3701 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3707 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 143: -#line 1277 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1283 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3712 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3718 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 144: -#line 1285 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1291 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3720,11 +3726,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3724 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3730 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 145: -#line 1294 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1300 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -3732,11 +3738,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3736 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3742 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 146: -#line 1304 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1310 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3744,11 +3750,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3748 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3754 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 147: -#line 1313 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1319 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -3756,33 +3762,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3760 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3766 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 148: -#line 1323 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1329 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3771 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3777 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 149: -#line 1331 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1337 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 3782 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3788 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 150: -#line 1339 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1345 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3790,11 +3796,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3794 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3800 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 151: -#line 1349 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1355 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3802,11 +3808,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3806 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3812 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 152: -#line 1358 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1364 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(2); @@ -3814,11 +3820,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3818 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3824 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 153: -#line 1368 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1374 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3826,11 +3832,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3830 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3836 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 154: -#line 1377 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1383 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3838,11 +3844,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3842 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3848 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 155: -#line 1386 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1392 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3850,11 +3856,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3854 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3860 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 156: -#line 1396 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1402 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(2); @@ -3862,11 +3868,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3866 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3872 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 157: -#line 1406 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1412 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(3); @@ -3874,11 +3880,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3878 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3884 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 158: -#line 1415 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1421 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(2); @@ -3886,11 +3892,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3890 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3896 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 159: -#line 1425 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1431 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3898,11 +3904,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3902 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3908 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 160: -#line 1434 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1440 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3910,11 +3916,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3914 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3920 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 161: -#line 1443 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1449 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3922,11 +3928,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3926 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3932 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 162: -#line 1452 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1458 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3934,11 +3940,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3938 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3944 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 163: -#line 1461 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1467 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3946,11 +3952,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3950 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3956 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 164: -#line 1470 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1476 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3958,11 +3964,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3962 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3968 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 165: -#line 1480 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1486 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3970,11 +3976,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3974 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3980 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 166: -#line 1489 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1495 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3982,11 +3988,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3986 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 3992 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 167: -#line 1498 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1504 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -3994,11 +4000,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 3998 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4004 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 168: -#line 1507 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1513 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4006,11 +4012,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4010 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4016 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 169: -#line 1516 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1522 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4018,11 +4024,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4022 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4028 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 170: -#line 1526 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1532 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4030,11 +4036,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4034 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4040 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 171: -#line 1535 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1541 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4042,11 +4048,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4046 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4052 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 172: -#line 1544 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1550 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4054,11 +4060,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4058 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4064 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 173: -#line 1553 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1559 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4066,11 +4072,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4070 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4076 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 174: -#line 1562 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1568 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4078,11 +4084,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4082 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4088 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 175: -#line 1571 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1577 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4090,11 +4096,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4094 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4100 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 176: -#line 1580 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1586 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4102,11 +4108,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4106 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4112 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 177: -#line 1589 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1595 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4114,11 +4120,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4118 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4124 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 178: -#line 1598 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1604 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4126,11 +4132,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4130 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4136 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 179: -#line 1607 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1613 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4138,11 +4144,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4142 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4148 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 180: -#line 1616 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1622 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4150,11 +4156,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4154 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4160 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 181: -#line 1625 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1631 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4162,11 +4168,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4166 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4172 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 182: -#line 1635 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1641 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4174,11 +4180,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4178 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4184 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 183: -#line 1645 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1651 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-2].str))); @@ -4187,11 +4193,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4191 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4197 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 184: -#line 1656 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1662 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4199,11 +4205,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4203 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4209 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 185: -#line 1666 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1672 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4211,11 +4217,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4215 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4221 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 186: -#line 1676 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1682 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4223,11 +4229,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4227 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4233 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 187: -#line 1685 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1691 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4235,11 +4241,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4239 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4245 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 188: -#line 1694 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1700 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4247,11 +4253,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4251 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4257 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 189: -#line 1703 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1709 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4259,11 +4265,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4263 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4269 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 190: -#line 1712 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1718 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4271,11 +4277,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4275 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4281 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 191: -#line 1721 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1727 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4283,11 +4289,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4287 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4293 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 192: -#line 1730 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1736 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4295,11 +4301,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4299 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4305 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 193: -#line 1740 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1746 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -4307,11 +4313,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4311 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4317 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 194: -#line 1750 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1756 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(7); jpCheckEmpty(7); @@ -4319,11 +4325,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4323 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4329 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 195: -#line 1760 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1766 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(7); jpCheckEmpty(7); @@ -4331,40 +4337,40 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4335 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4341 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 196: -#line 1770 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1776 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); } -#line 4344 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4350 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 197: -#line 1777 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1783 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); } -#line 4353 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4359 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 198: -#line 1783 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1789 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4364 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4370 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 199: -#line 1791 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1797 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4372,22 +4378,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4376 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4382 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 200: -#line 1800 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1806 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4387 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4393 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 201: -#line 1808 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1814 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4395,11 +4401,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4399 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4405 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 202: -#line 1818 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1824 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4407,11 +4413,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4411 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4417 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 203: -#line 1828 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1834 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4419,11 +4425,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4423 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4429 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 204: -#line 1837 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1843 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4431,11 +4437,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4435 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4441 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 205: -#line 1847 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1853 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4443,11 +4449,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4447 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4453 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 206: -#line 1856 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1862 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4455,58 +4461,58 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4459 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4465 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 207: -#line 1866 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1872 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); } -#line 4468 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4474 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 208: -#line 1873 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1879 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); } -#line 4477 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4483 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 209: -#line 1880 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1886 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(7); } -#line 4486 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4492 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 210: -#line 1888 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1894 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(9); } -#line 4495 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4501 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 211: -#line 1894 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1900 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4506 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4512 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 212: -#line 1902 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1908 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4514,22 +4520,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4518 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4524 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 213: -#line 1911 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1917 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4529 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4535 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 214: -#line 1919 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1925 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4537,33 +4543,33 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4541 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4547 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 215: -#line 1930 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1936 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(9); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4552 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4558 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 216: -#line 1938 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1944 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4563 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4569 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 217: -#line 1946 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1952 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4571,11 +4577,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4575 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4581 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 218: -#line 1956 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1962 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4583,11 +4589,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4587 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4593 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 219: -#line 1965 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1971 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4595,11 +4601,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4599 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4605 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 220: -#line 1975 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1981 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4607,11 +4613,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4611 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4617 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 221: -#line 1985 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 1991 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4619,11 +4625,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4623 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4629 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 222: -#line 1994 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2000 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4631,11 +4637,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4635 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4641 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 223: -#line 2004 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2010 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4643,11 +4649,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4647 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4653 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 224: -#line 2013 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2019 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -4655,11 +4661,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4659 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4665 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 225: -#line 2023 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2029 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4668,31 +4674,31 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4672 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4678 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 226: -#line 2033 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2039 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4683 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4689 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 227: -#line 2041 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2047 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); } -#line 4692 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4698 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 228: -#line 2048 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2054 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[-1].str))); @@ -4701,11 +4707,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4705 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4711 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 229: -#line 2059 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2065 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4713,11 +4719,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4717 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4723 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 230: -#line 2069 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2075 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4725,11 +4731,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4729 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4735 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 231: -#line 2079 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2085 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -4737,11 +4743,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4741 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4747 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 232: -#line 2089 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2095 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4749,11 +4755,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4753 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4759 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 233: -#line 2098 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2104 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -4761,22 +4767,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4765 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4771 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 234: -#line 2107 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2113 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4776 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4782 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 235: -#line 2115 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2121 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4784,11 +4790,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4788 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4794 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 236: -#line 2125 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2131 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4796,11 +4802,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4800 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4806 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 237: -#line 2134 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2140 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4808,20 +4814,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4812 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4818 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 238: -#line 2144 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2150 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); } -#line 4821 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4827 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 239: -#line 2151 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2157 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -4829,11 +4835,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4833 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4839 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 240: -#line 2161 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2167 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4841,11 +4847,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4845 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4851 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 241: -#line 2170 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2176 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4853,11 +4859,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4857 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4863 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 242: -#line 2180 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2186 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4865,20 +4871,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4869 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4875 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 243: -#line 2189 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2195 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); } -#line 4878 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4884 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 244: -#line 2195 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2201 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -4886,11 +4892,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4890 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4896 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 245: -#line 2204 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2210 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4898,11 +4904,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4902 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4908 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 246: -#line 2213 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2219 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4910,11 +4916,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4914 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4920 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 247: -#line 2222 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2228 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4922,11 +4928,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4926 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4932 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 248: -#line 2231 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2237 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4934,11 +4940,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4938 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4944 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 249: -#line 2241 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2247 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(6); jpCheckEmpty(6); @@ -4946,22 +4952,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4950 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4956 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 250: -#line 2250 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2256 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4961 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4967 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 251: -#line 2258 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2264 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4969,22 +4975,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4973 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4979 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 252: -#line 2267 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2273 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 4984 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 4990 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 253: -#line 2275 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2281 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -4992,11 +4998,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 4996 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5002 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 254: -#line 2285 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2291 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5004,11 +5010,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5008 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5014 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 255: -#line 2294 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2300 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5016,11 +5022,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5020 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5026 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 256: -#line 2304 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2310 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5028,11 +5034,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5032 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5038 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 257: -#line 2313 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2319 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5040,11 +5046,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5044 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5050 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 258: -#line 2322 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2328 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5052,11 +5058,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5056 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5062 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 259: -#line 2331 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2337 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5064,22 +5070,22 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5068 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5074 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 260: -#line 2340 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2346 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(0); (yyval.str) = 0; yyGetParser->SetCurrentCombine(""); } -#line 5079 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5085 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 261: -#line 2348 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2354 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5087,11 +5093,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5091 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5097 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 262: -#line 2358 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2364 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5099,11 +5105,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5103 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5109 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 263: -#line 2367 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2373 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5111,11 +5117,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5115 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5121 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 264: -#line 2377 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2383 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5123,29 +5129,29 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5127 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5133 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 265: -#line 2387 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2393 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); } -#line 5136 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5142 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 266: -#line 2393 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2399 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); } -#line 5145 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5151 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 267: -#line 2400 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2406 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5154,11 +5160,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5158 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5164 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 268: -#line 2410 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2416 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5167,11 +5173,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5171 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5177 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 269: -#line 2420 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2426 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5180,11 +5186,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5184 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5190 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 270: -#line 2430 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2436 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5193,11 +5199,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5197 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5203 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 271: -#line 2441 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2447 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5206,11 +5212,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5210 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5216 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 272: -#line 2451 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2457 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-5].str))); @@ -5220,11 +5226,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5224 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5230 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 273: -#line 2462 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2468 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5233,11 +5239,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5237 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5243 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 274: -#line 2472 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2478 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(6); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5246,11 +5252,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5250 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5256 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 275: -#line 2483 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2489 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); yyGetParser->DeallocateParserType(&((yyvsp[-3].str))); @@ -5259,11 +5265,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5263 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5269 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 276: -#line 2493 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2499 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5271,11 +5277,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5275 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5281 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 277: -#line 2503 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2509 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5283,11 +5289,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5287 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5293 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 278: -#line 2512 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2518 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5295,11 +5301,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5299 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5305 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 279: -#line 2521 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2527 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5307,11 +5313,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5311 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5317 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 280: -#line 2530 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2536 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5319,11 +5325,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5323 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5329 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 281: -#line 2539 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2545 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5331,11 +5337,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5335 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5341 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 282: -#line 2549 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2555 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5343,11 +5349,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5347 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5353 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 283: -#line 2559 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2565 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5355,11 +5361,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5359 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5365 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 284: -#line 2569 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2575 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5367,11 +5373,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5371 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5377 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 285: -#line 2578 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2584 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5379,11 +5385,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5383 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5389 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 286: -#line 2587 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2593 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5391,11 +5397,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5395 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5401 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 287: -#line 2596 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2602 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5403,11 +5409,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5407 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5413 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 288: -#line 2605 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2611 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5415,11 +5421,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5419 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5425 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 289: -#line 2615 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2621 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5427,11 +5433,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5431 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5437 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 290: -#line 2625 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2631 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5439,11 +5445,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5443 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5449 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 291: -#line 2635 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2641 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5451,11 +5457,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5455 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5461 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 292: -#line 2644 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2650 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5463,11 +5469,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5467 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5473 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 293: -#line 2653 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2659 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(2); jpCheckEmpty(2); @@ -5475,11 +5481,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5479 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5485 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 294: -#line 2662 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2668 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5487,11 +5493,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5491 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5497 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 295: -#line 2672 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2678 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -5499,11 +5505,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5503 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5509 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 296: -#line 2681 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2687 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(4); jpCheckEmpty(4); @@ -5511,20 +5517,20 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5515 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5521 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 297: -#line 2690 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2696 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); } -#line 5524 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5530 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 298: -#line 2697 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2703 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5532,11 +5538,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5536 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5542 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 299: -#line 2706 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2712 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5544,11 +5550,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5548 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5554 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 300: -#line 2715 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2721 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5556,11 +5562,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5560 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5566 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 301: -#line 2724 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2730 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5568,11 +5574,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5572 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5578 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 302: -#line 2734 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2740 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5580,11 +5586,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5584 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5590 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 303: -#line 2743 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2749 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5592,11 +5598,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5596 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5602 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 304: -#line 2752 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2758 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5604,11 +5610,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5608 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5614 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 305: -#line 2762 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2768 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5616,11 +5622,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5620 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5626 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 306: -#line 2771 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2777 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5628,11 +5634,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5632 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5638 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 307: -#line 2780 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2786 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5640,11 +5646,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5644 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5650 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 308: -#line 2789 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2795 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5652,11 +5658,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5656 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5662 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 309: -#line 2799 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2805 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5664,11 +5670,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5668 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5674 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 310: -#line 2808 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2814 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5676,11 +5682,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5680 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5686 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 311: -#line 2817 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2823 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5688,11 +5694,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5692 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5698 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 312: -#line 2826 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2832 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5700,11 +5706,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5704 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5710 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 313: -#line 2835 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2841 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5712,11 +5718,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5716 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5722 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 314: -#line 2844 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2850 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5724,11 +5730,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5728 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5734 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 315: -#line 2854 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2860 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5736,11 +5742,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5740 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5746 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 316: -#line 2863 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2869 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5748,11 +5754,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5752 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5758 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 317: -#line 2872 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2878 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5760,11 +5766,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5764 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5770 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 318: -#line 2882 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2888 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5772,11 +5778,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5776 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5782 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 319: -#line 2891 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2897 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5784,11 +5790,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5788 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5794 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 320: -#line 2901 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2907 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5796,11 +5802,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5800 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5806 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 321: -#line 2910 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2916 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5808,11 +5814,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5812 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5818 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 322: -#line 2920 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2926 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5820,11 +5826,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5824 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5830 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 323: -#line 2929 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2935 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5832,11 +5838,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5836 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5842 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 324: -#line 2939 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2945 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5844,11 +5850,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5848 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5854 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 325: -#line 2948 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2954 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5856,11 +5862,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5860 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5866 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 326: -#line 2958 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2964 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5868,11 +5874,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5872 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5878 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 327: -#line 2967 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2973 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5880,11 +5886,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5884 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5890 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 328: -#line 2977 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2983 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5892,11 +5898,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5896 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5902 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 329: -#line 2986 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 2992 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(5); jpCheckEmpty(5); @@ -5904,11 +5910,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5908 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5914 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 330: -#line 2996 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3002 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5916,11 +5922,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5920 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5926 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 331: -#line 3005 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3011 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5928,11 +5934,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5932 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5938 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 332: -#line 3015 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3021 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpCheckEmpty(3); @@ -5940,11 +5946,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5944 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5950 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 333: -#line 3025 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3031 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); yyGetParser->DeallocateParserType(&((yyvsp[0].str))); @@ -5953,11 +5959,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5957 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5963 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 334: -#line 3035 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3041 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5965,11 +5971,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5969 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5975 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 335: -#line 3044 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3050 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5977,11 +5983,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5981 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5987 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 336: -#line 3054 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3060 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -5989,11 +5995,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 5993 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 5999 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 337: -#line 3063 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3069 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6001,11 +6007,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6005 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6011 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 338: -#line 3072 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3078 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6013,11 +6019,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6017 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6023 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 339: -#line 3081 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3087 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6025,11 +6031,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6029 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6035 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 340: -#line 3090 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3096 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6037,11 +6043,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6041 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6047 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 341: -#line 3099 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3105 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6049,11 +6055,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6053 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6059 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 342: -#line 3108 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3114 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6061,11 +6067,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6065 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6071 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 343: -#line 3117 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3123 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6073,11 +6079,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6077 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6083 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 344: -#line 3126 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3132 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6085,11 +6091,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6089 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6095 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 345: -#line 3135 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3141 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6097,11 +6103,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6101 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6107 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 346: -#line 3144 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3150 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6109,11 +6115,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6113 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6119 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 347: -#line 3153 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3159 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6121,11 +6127,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6125 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6131 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 348: -#line 3163 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3169 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6133,11 +6139,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6137 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6143 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 349: -#line 3173 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3179 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6145,11 +6151,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6149 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6155 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 350: -#line 3183 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3189 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(1); jpCheckEmpty(1); @@ -6157,11 +6163,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6161 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6167 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; case 351: -#line 3192 "cmDependsJavaParser.y" /* yacc.c:1646 */ +#line 3198 "cmDependsJavaParser.y" /* yacc.c:1646 */ { jpElementStart(3); jpStoreClass((yyvsp[-2].str)); @@ -6170,11 +6176,11 @@ yyreduce: yyGetParser->SetCurrentCombine(""); } -#line 6174 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6180 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ break; -#line 6178 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ +#line 6184 "cmDependsJavaParser.cxx" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -6404,7 +6410,7 @@ yyreturn: #endif return yyresult; } -#line 3201 "cmDependsJavaParser.y" /* yacc.c:1906 */ +#line 3207 "cmDependsJavaParser.y" /* yacc.c:1906 */ /* End of grammar */ diff --git a/Source/cmDependsJavaParser.y b/Source/cmDependsJavaParser.y index ea7ca0f..150ac92 100644 --- a/Source/cmDependsJavaParser.y +++ b/Source/cmDependsJavaParser.y @@ -14,6 +14,12 @@ Modify cmDependsJavaParser.cxx: */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <stdlib.h> +#include <string.h> +#include <string> + #define yyGetParser (cmDependsJava_yyget_extra(yyscanner)) /*-------------------------------------------------------------------------*/ diff --git a/Source/cmDependsJavaParserHelper.h b/Source/cmDependsJavaParserHelper.h index 71b939c..5f28f70 100644 --- a/Source/cmDependsJavaParserHelper.h +++ b/Source/cmDependsJavaParserHelper.h @@ -8,26 +8,18 @@ #include <string> #include <vector> -class cmDependsJavaParserHelper; - -#define YYSTYPE cmDependsJavaParserHelper::ParserType -#define YYSTYPE_IS_DECLARED -#define YY_EXTRA_TYPE cmDependsJavaParserHelper* -#define YY_DECL int cmDependsJava_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) - /** \class cmDependsJavaParserHelper * \brief Helper class for parsing java source files * * Finds dependencies for java file and list of outputs */ - class cmDependsJavaParserHelper { public: - typedef struct + struct ParserType { char* str; - } ParserType; + }; cmDependsJavaParserHelper(); ~cmDependsJavaParserHelper(); @@ -96,4 +88,9 @@ private: void CleanupParser(); }; +#define YYSTYPE cmDependsJavaParserHelper::ParserType +#define YYSTYPE_IS_DECLARED +#define YY_EXTRA_TYPE cmDependsJavaParserHelper* +#define YY_DECL int cmDependsJava_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) + #endif diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index e3fb412..deecad8 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -9,7 +9,6 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" diff --git a/Source/cmExprParser.cxx b/Source/cmExprParser.cxx index d11d0b6..a9088a6 100644 --- a/Source/cmExprParser.cxx +++ b/Source/cmExprParser.cxx @@ -85,14 +85,17 @@ Modify cmExprParser.cxx: */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <stdlib.h> +#include <string.h> + /*-------------------------------------------------------------------------*/ #define YYDEBUG 1 #include "cmExprParserHelper.h" /* Interface to parser object. */ #include "cmExprLexer.h" /* Interface to lexer object. */ #include "cmExprParserTokens.h" /* Need YYSTYPE for YY_DECL. */ -#include <math.h> - /* Forward declare the lexer entry point. */ YY_DECL; @@ -105,7 +108,7 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message); # pragma warning (disable: 4065) /* Switch statement contains default but no case. */ #endif -#line 109 "cmExprParser.cxx" /* yacc.c:339 */ +#line 112 "cmExprParser.cxx" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -182,7 +185,7 @@ int cmExpr_yyparse (yyscan_t yyscanner); /* Copy the second part of user declarations. */ -#line 186 "cmExprParser.cxx" /* yacc.c:358 */ +#line 189 "cmExprParser.cxx" /* yacc.c:358 */ #ifdef short # undef short @@ -481,9 +484,9 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 70, 70, 75, 78, 83, 86, 91, 94, 99, - 102, 105, 110, 113, 116, 121, 124, 127, 130, 135, - 138, 141, 146, 149 + 0, 73, 73, 78, 81, 86, 89, 94, 97, 102, + 105, 108, 113, 116, 119, 124, 127, 130, 133, 138, + 141, 144, 149, 152 }; #endif @@ -1278,183 +1281,183 @@ yyreduce: switch (yyn) { case 2: -#line 70 "cmExprParser.y" /* yacc.c:1646 */ +#line 73 "cmExprParser.y" /* yacc.c:1646 */ { cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number)); } -#line 1286 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1289 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 3: -#line 75 "cmExprParser.y" /* yacc.c:1646 */ +#line 78 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1294 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1297 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 4: -#line 78 "cmExprParser.y" /* yacc.c:1646 */ +#line 81 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number); } -#line 1302 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1305 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 5: -#line 83 "cmExprParser.y" /* yacc.c:1646 */ +#line 86 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1310 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1313 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 6: -#line 86 "cmExprParser.y" /* yacc.c:1646 */ +#line 89 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number); } -#line 1318 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1321 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 7: -#line 91 "cmExprParser.y" /* yacc.c:1646 */ +#line 94 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1326 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1329 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 8: -#line 94 "cmExprParser.y" /* yacc.c:1646 */ +#line 97 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number); } -#line 1334 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1337 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 9: -#line 99 "cmExprParser.y" /* yacc.c:1646 */ +#line 102 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1342 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1345 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 10: -#line 102 "cmExprParser.y" /* yacc.c:1646 */ +#line 105 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number); } -#line 1350 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1353 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 11: -#line 105 "cmExprParser.y" /* yacc.c:1646 */ +#line 108 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number); } -#line 1358 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1361 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 12: -#line 110 "cmExprParser.y" /* yacc.c:1646 */ +#line 113 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1366 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1369 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 13: -#line 113 "cmExprParser.y" /* yacc.c:1646 */ +#line 116 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number); } -#line 1374 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1377 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 14: -#line 116 "cmExprParser.y" /* yacc.c:1646 */ +#line 119 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number); } -#line 1382 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1385 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 15: -#line 121 "cmExprParser.y" /* yacc.c:1646 */ +#line 124 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1390 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1393 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 16: -#line 124 "cmExprParser.y" /* yacc.c:1646 */ +#line 127 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number); } -#line 1398 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1401 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 17: -#line 127 "cmExprParser.y" /* yacc.c:1646 */ +#line 130 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number); } -#line 1406 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1409 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 18: -#line 130 "cmExprParser.y" /* yacc.c:1646 */ +#line 133 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number); } -#line 1414 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1417 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 19: -#line 135 "cmExprParser.y" /* yacc.c:1646 */ +#line 138 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1422 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1425 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 20: -#line 138 "cmExprParser.y" /* yacc.c:1646 */ +#line 141 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = + (yyvsp[0].Number); } -#line 1430 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1433 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 21: -#line 141 "cmExprParser.y" /* yacc.c:1646 */ +#line 144 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = - (yyvsp[0].Number); } -#line 1438 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1441 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 22: -#line 146 "cmExprParser.y" /* yacc.c:1646 */ +#line 149 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[0].Number); } -#line 1446 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1449 "cmExprParser.cxx" /* yacc.c:1646 */ break; case 23: -#line 149 "cmExprParser.y" /* yacc.c:1646 */ +#line 152 "cmExprParser.y" /* yacc.c:1646 */ { (yyval.Number) = (yyvsp[-1].Number); } -#line 1454 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1457 "cmExprParser.cxx" /* yacc.c:1646 */ break; -#line 1458 "cmExprParser.cxx" /* yacc.c:1646 */ +#line 1461 "cmExprParser.cxx" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1684,7 +1687,7 @@ yyreturn: #endif return yyresult; } -#line 154 "cmExprParser.y" /* yacc.c:1906 */ +#line 157 "cmExprParser.y" /* yacc.c:1906 */ /* End of grammar */ diff --git a/Source/cmExprParser.y b/Source/cmExprParser.y index c7c4a7b..0429663 100644 --- a/Source/cmExprParser.y +++ b/Source/cmExprParser.y @@ -14,14 +14,17 @@ Modify cmExprParser.cxx: */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <stdlib.h> +#include <string.h> + /*-------------------------------------------------------------------------*/ #define YYDEBUG 1 #include "cmExprParserHelper.h" /* Interface to parser object. */ #include "cmExprLexer.h" /* Interface to lexer object. */ #include "cmExprParserTokens.h" /* Need YYSTYPE for YY_DECL. */ -#include <math.h> - /* Forward declare the lexer entry point. */ YY_DECL; diff --git a/Source/cmExprParserHelper.h b/Source/cmExprParserHelper.h index 8f00f1d..df365fc 100644 --- a/Source/cmExprParserHelper.h +++ b/Source/cmExprParserHelper.h @@ -8,23 +8,13 @@ #include <string> #include <vector> -#define YYSTYPE cmExprParserHelper::ParserType -#define YYSTYPE_IS_DECLARED -#define YY_EXTRA_TYPE cmExprParserHelper* -#define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) - -/** \class cmExprParserHelper - * \brief Helper class for parsing java source files - * - * Finds dependencies for java file and list of outputs - */ class cmExprParserHelper { public: - typedef struct + struct ParserType { int Number; - } ParserType; + }; cmExprParserHelper(); ~cmExprParserHelper(); @@ -57,4 +47,9 @@ private: std::string ErrorString; }; +#define YYSTYPE cmExprParserHelper::ParserType +#define YYSTYPE_IS_DECLARED +#define YY_EXTRA_TYPE cmExprParserHelper* +#define YY_DECL int cmExpr_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) + #endif diff --git a/Source/cmFilePathChecksum.cxx b/Source/cmFilePathChecksum.cxx index 3d8b695..62f52e5 100644 --- a/Source/cmFilePathChecksum.cxx +++ b/Source/cmFilePathChecksum.cxx @@ -45,7 +45,7 @@ void cmFilePathChecksum::setupParentDirs(const std::string& currentSrcDir, parentDirs[3].second = "ProjectBinary"; } -std::string cmFilePathChecksum::get(const std::string& filePath) +std::string cmFilePathChecksum::get(const std::string& filePath) const { std::string relPath; std::string relSeed; @@ -82,7 +82,7 @@ std::string cmFilePathChecksum::get(const std::string& filePath) } std::string cmFilePathChecksum::getPart(const std::string& filePath, - size_t length) + size_t length) const { return get(filePath).substr(0, length); } diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h index df19053..59ca34c 100644 --- a/Source/cmFilePathChecksum.h +++ b/Source/cmFilePathChecksum.h @@ -47,13 +47,13 @@ public: /* @brief Calculates the path checksum for the parent directory of a file * */ - std::string get(const std::string& filePath); + std::string get(const std::string& filePath) const; /* @brief Same as get() but returns only the first length characters * */ std::string getPart(const std::string& filePath, - size_t length = partLengthDefault); + size_t length = partLengthDefault) const; private: /// Size of the parent directory list diff --git a/Source/cmFortranParser.cxx b/Source/cmFortranParser.cxx index 896e589..c67227f 100644 --- a/Source/cmFortranParser.cxx +++ b/Source/cmFortranParser.cxx @@ -97,13 +97,17 @@ Modify cmFortranParser.cxx: - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"] */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <cmsys/String.h> +#include <stdlib.h> +#include <string.h> + /*-------------------------------------------------------------------------*/ #define cmFortranParser_cxx #include "cmFortranParser.h" /* Interface to parser object. */ #include "cmFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */ -#include <cmsys/String.h> - /* Forward declare the lexer entry point. */ YY_DECL; @@ -124,7 +128,7 @@ static void cmFortran_yyerror(yyscan_t yyscanner, const char* message) # pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */ #endif -#line 137 "cmFortranParser.cxx" /* yacc.c:339 */ +#line 132 "cmFortranParser.cxx" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -244,11 +248,11 @@ extern int cmFortran_yydebug; union YYSTYPE { -#line 75 "cmFortranParser.y" /* yacc.c:355 */ +#line 70 "cmFortranParser.y" /* yacc.c:355 */ char* string; -#line 261 "cmFortranParser.cxx" /* yacc.c:355 */ +#line 256 "cmFortranParser.cxx" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; @@ -264,7 +268,7 @@ int cmFortran_yyparse (yyscan_t yyscanner); /* Copy the second part of user declarations. */ -#line 277 "cmFortranParser.cxx" /* yacc.c:358 */ +#line 272 "cmFortranParser.cxx" /* yacc.c:358 */ #ifdef short # undef short @@ -565,13 +569,13 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 103, 103, 103, 106, 110, 115, 124, 130, 137, - 142, 146, 151, 159, 164, 169, 174, 179, 184, 189, - 194, 199, 203, 207, 211, 215, 216, 221, 221, 221, - 222, 222, 223, 223, 224, 224, 225, 225, 226, 226, - 227, 227, 228, 228, 229, 229, 230, 230, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248 + 0, 98, 98, 98, 101, 105, 110, 119, 125, 132, + 137, 141, 146, 154, 159, 164, 169, 174, 179, 184, + 189, 194, 198, 202, 206, 210, 211, 216, 216, 216, + 217, 217, 218, 218, 219, 219, 220, 220, 221, 221, + 222, 222, 223, 223, 224, 224, 225, 225, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243 }; #endif @@ -1523,26 +1527,26 @@ yyreduce: switch (yyn) { case 4: -#line 106 "cmFortranParser.y" /* yacc.c:1646 */ +#line 101 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); } -#line 1541 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1536 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 5: -#line 110 "cmFortranParser.y" /* yacc.c:1646 */ +#line 105 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1551 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1546 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 6: -#line 115 "cmFortranParser.y" /* yacc.c:1646 */ +#line 110 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 && @@ -1552,22 +1556,22 @@ yyreduce: } free((yyvsp[-2].string)); } -#line 1565 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1560 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 7: -#line 124 "cmFortranParser.y" /* yacc.c:1646 */ +#line 119 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-4].string)); free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1576 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1571 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 8: -#line 130 "cmFortranParser.y" /* yacc.c:1646 */ +#line 125 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-6].string)); @@ -1575,40 +1579,40 @@ yyreduce: free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1588 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1583 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 9: -#line 137 "cmFortranParser.y" /* yacc.c:1646 */ +#line 132 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); free((yyvsp[-2].string)); } -#line 1598 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1593 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 10: -#line 142 "cmFortranParser.y" /* yacc.c:1646 */ +#line 137 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, false); } -#line 1607 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1602 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 11: -#line 146 "cmFortranParser.y" /* yacc.c:1646 */ +#line 141 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1617 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1612 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 12: -#line 151 "cmFortranParser.y" /* yacc.c:1646 */ +#line 146 "cmFortranParser.y" /* yacc.c:1646 */ { if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); @@ -1617,139 +1621,139 @@ yyreduce: free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1630 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1625 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 13: -#line 159 "cmFortranParser.y" /* yacc.c:1646 */ +#line 154 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1640 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1635 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 14: -#line 164 "cmFortranParser.y" /* yacc.c:1646 */ +#line 159 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1650 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1645 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 15: -#line 169 "cmFortranParser.y" /* yacc.c:1646 */ +#line 164 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1660 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1655 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 16: -#line 174 "cmFortranParser.y" /* yacc.c:1646 */ +#line 169 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1670 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1665 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 17: -#line 179 "cmFortranParser.y" /* yacc.c:1646 */ +#line 174 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleDefine(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1680 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1675 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 18: -#line 184 "cmFortranParser.y" /* yacc.c:1646 */ +#line 179 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1690 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1685 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 19: -#line 189 "cmFortranParser.y" /* yacc.c:1646 */ +#line 184 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1700 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1695 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 20: -#line 194 "cmFortranParser.y" /* yacc.c:1646 */ +#line 189 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1710 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1705 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 21: -#line 199 "cmFortranParser.y" /* yacc.c:1646 */ +#line 194 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIf(parser); } -#line 1719 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1714 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 22: -#line 203 "cmFortranParser.y" /* yacc.c:1646 */ +#line 198 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElif(parser); } -#line 1728 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1723 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 23: -#line 207 "cmFortranParser.y" /* yacc.c:1646 */ +#line 202 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElse(parser); } -#line 1737 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1732 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 24: -#line 211 "cmFortranParser.y" /* yacc.c:1646 */ +#line 206 "cmFortranParser.y" /* yacc.c:1646 */ { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleEndif(parser); } -#line 1746 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1741 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 48: -#line 233 "cmFortranParser.y" /* yacc.c:1646 */ +#line 228 "cmFortranParser.y" /* yacc.c:1646 */ { free ((yyvsp[0].string)); } -#line 1752 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1747 "cmFortranParser.cxx" /* yacc.c:1646 */ break; case 55: -#line 240 "cmFortranParser.y" /* yacc.c:1646 */ +#line 235 "cmFortranParser.y" /* yacc.c:1646 */ { free ((yyvsp[0].string)); } -#line 1758 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1753 "cmFortranParser.cxx" /* yacc.c:1646 */ break; -#line 1762 "cmFortranParser.cxx" /* yacc.c:1646 */ +#line 1757 "cmFortranParser.cxx" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1979,6 +1983,6 @@ yyreturn: #endif return yyresult; } -#line 251 "cmFortranParser.y" /* yacc.c:1906 */ +#line 246 "cmFortranParser.y" /* yacc.c:1906 */ /* End of grammar */ diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h index 06985d2..e8273fb 100644 --- a/Source/cmFortranParser.h +++ b/Source/cmFortranParser.h @@ -6,7 +6,9 @@ #if !defined(cmFortranLexer_cxx) && !defined(cmFortranParser_cxx) #include <cmConfigure.h> -#include "cmStandardIncludes.h" +#include <set> +#include <string> +#include <vector> #endif #include <stddef.h> /* size_t */ diff --git a/Source/cmFortranParser.y b/Source/cmFortranParser.y index 7eb5ef5..3d68134 100644 --- a/Source/cmFortranParser.y +++ b/Source/cmFortranParser.y @@ -26,13 +26,17 @@ Modify cmFortranParser.cxx: - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"] */ +#include <cmConfigure.h> // IWYU pragma: keep + +#include <cmsys/String.h> +#include <stdlib.h> +#include <string.h> + /*-------------------------------------------------------------------------*/ #define cmFortranParser_cxx #include "cmFortranParser.h" /* Interface to parser object. */ #include "cmFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */ -#include <cmsys/String.h> - /* Forward declare the lexer entry point. */ YY_DECL; diff --git a/Source/cmFortranParserTokens.h b/Source/cmFortranParserTokens.h index 18b9e0a..8d6a5fe 100644 --- a/Source/cmFortranParserTokens.h +++ b/Source/cmFortranParserTokens.h @@ -130,7 +130,7 @@ extern int cmFortran_yydebug; union YYSTYPE { -#line 75 "cmFortranParser.y" /* yacc.c:1909 */ +#line 70 "cmFortranParser.y" /* yacc.c:1909 */ char* string; diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index d11ee7c..2312bc0 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -109,6 +109,18 @@ void cmGlobalVisualStudio15Generator::WriteSLNHeader(std::ostream& fout) } } +bool cmGlobalVisualStudio15Generator::InitializeWindows(cmMakefile* mf) +{ + // If the Win 8.1 SDK is installed then we can select a SDK matching + // the target Windows version. + if (this->IsWin81SDKInstalled()) { + return cmGlobalVisualStudio14Generator::InitializeWindows(mf); + } + // Otherwise we must choose a Win 10 SDK even if we are not targeting + // Windows 10. + return this->SelectWindows10SDK(mf, false); +} + bool cmGlobalVisualStudio15Generator::SelectWindowsStoreToolset( std::string& toolset) const { @@ -135,6 +147,28 @@ bool cmGlobalVisualStudio15Generator::IsWindowsStoreToolsetInstalled() const return vsSetupAPIHelper.IsWin10SDKInstalled(); } +bool cmGlobalVisualStudio15Generator::IsWin81SDKInstalled() const +{ + // Does the VS installer tool know about one? + if (vsSetupAPIHelper.IsWin81SDKInstalled()) { + return true; + } + + // Does the registry know about one (e.g. from VS 2015)? + std::string win81Root; + if (cmSystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + "Windows Kits\\Installed Roots;KitsRoot81", + win81Root, cmSystemTools::KeyWOW64_32) || + cmSystemTools::ReadRegistryValue( + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\" + "Windows Kits\\Installed Roots;KitsRoot81", + win81Root, cmSystemTools::KeyWOW64_32)) { + return true; + } + return false; +} + std::string cmGlobalVisualStudio15Generator::FindMSBuildCommand() { std::string msbuild; diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudio15Generator.h index 781b41e..f979b65 100644 --- a/Source/cmGlobalVisualStudio15Generator.h +++ b/Source/cmGlobalVisualStudio15Generator.h @@ -28,6 +28,7 @@ public: virtual const char* GetToolsVersion() { return "15.0"; } protected: + bool InitializeWindows(cmMakefile* mf) CM_OVERRIDE; virtual bool SelectWindowsStoreToolset(std::string& toolset) const; virtual const char* GetIDEVersion() { return "15.0"; } @@ -40,6 +41,9 @@ protected: // of the toolset is installed bool IsWindowsStoreToolsetInstalled() const; + // Check for a Win 8 SDK known to the registry or VS installer tool. + bool IsWin81SDKInstalled() const; + std::string FindMSBuildCommand() CM_OVERRIDE; std::string FindDevEnvCommand() CM_OVERRIDE; diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index 6a700ff..6789555 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -2,10 +2,18 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkLineDeviceComputer.h" + +#include <set> +#include <sstream> +#include <vector> + #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmGlobalNinjaGenerator.h" -#include "cmOutputConverter.h" +#include "cmStateDirectory.h" +#include "cmStateTypes.h" + +class cmOutputConverter; cmLinkLineDeviceComputer::cmLinkLineDeviceComputer( cmOutputConverter* outputConverter, cmStateDirectory stateDir) diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h index f4bb3eb..f275a0d 100644 --- a/Source/cmLinkLineDeviceComputer.h +++ b/Source/cmLinkLineDeviceComputer.h @@ -4,8 +4,17 @@ #ifndef cmLinkLineDeviceComputer_h #define cmLinkLineDeviceComputer_h +#include <cmConfigure.h> + +#include <string> + #include "cmLinkLineComputer.h" + +class cmComputeLinkInformation; +class cmGeneratorTarget; class cmGlobalNinjaGenerator; +class cmOutputConverter; +class cmStateDirectory; class cmLinkLineDeviceComputer : public cmLinkLineComputer { diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 39e5684..5cf1853 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -2,22 +2,21 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLoadCommandCommand.h" +#include <signal.h> +#include <sstream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #include "cmCPluginAPI.cxx" #include "cmCPluginAPI.h" #include "cmDynamicLoader.h" #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmState.h" #include "cmSystemTools.h" class cmExecutionStatus; -#include <signal.h> -#include <sstream> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - #ifdef __QNX__ #include <malloc.h> /* for malloc/free on QNX */ #endif diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 44c390c..07d712c 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -13,7 +13,6 @@ #include "cmInstallScriptGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmLinkLineComputer.h" -#include "cmLinkLineDeviceComputer.h" #include "cmMakefile.h" #include "cmRulePlaceholderExpander.h" #include "cmSourceFile.h" diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bdaca97..b3d7a04 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3354,7 +3354,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) { const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE"); std::string mods = cmSystemTools::GetCMakeRoot() + "/Modules/"; - if (currentFile && strncmp(currentFile, mods.c_str(), mods.size()) == 0) { + if (currentFile && cmSystemTools::IsSubDirectory(currentFile, mods)) { switch (this->GetPolicyStatus(cmPolicies::CMP0017)) { case cmPolicies::WARN: { std::ostringstream e; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index b76ddeb..8ed5051 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileExecutableTargetGenerator.h" +#include <algorithm> #include <sstream> #include <string> #include <vector> diff --git a/Source/cmMakefileExecutableTargetGenerator.h b/Source/cmMakefileExecutableTargetGenerator.h index 642182b..598ac3d 100644 --- a/Source/cmMakefileExecutableTargetGenerator.h +++ b/Source/cmMakefileExecutableTargetGenerator.h @@ -5,6 +5,8 @@ #include <cmConfigure.h> +#include <string> + #include "cmMakefileTargetGenerator.h" class cmGeneratorTarget; diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index ff8b604..bc456cf 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -2,8 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmMakefileLibraryTargetGenerator.h" -#include <cmConfigure.h> // IWYU pragma: keep - +#include <algorithm> #include <sstream> #include <vector> diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 866c132..54b3f36 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -590,7 +590,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::vector<std::string> compileCommands; if (lang == "CUDA") { std::string cmdVar; - if (this->GeneratorTarget->GetProperty("CUDA_SEPARABLE_COMPILATION")) { + if (this->GeneratorTarget->GetPropertyAsBool( + "CUDA_SEPARABLE_COMPILATION")) { cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION"); } else { cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION"); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 0b33b19..f096416 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -580,7 +580,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::vector<std::string> compileCmds; if (lang == "CUDA") { std::string cmdVar; - if (this->GeneratorTarget->GetProperty("CUDA_SEPARABLE_COMPILATION")) { + if (this->GeneratorTarget->GetPropertyAsBool( + "CUDA_SEPARABLE_COMPILATION")) { cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION"); } else { cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION"); diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index f120971..3db0fec 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -10,7 +10,6 @@ #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmSourceFile.h" #include "cmSystemTools.h" #include "cmTarget.h" diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 825eba0..52112ff 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -22,7 +22,6 @@ #endif #include <algorithm> -#include <assert.h> #include <cmConfigure.h> #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> @@ -55,6 +54,13 @@ static std::string utilStripCR(std::string const& line) return line; } +static std::string GetSafeProperty(cmGeneratorTarget const* target, + const char* key) +{ + const char* tmp = target->GetProperty(key); + return std::string((tmp != CM_NULLPTR) ? tmp : ""); +} + static std::string GetAutogenTargetName(cmGeneratorTarget const* target) { std::string autogenTargetName = target->GetName(); @@ -98,19 +104,53 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target) return qtMajorVersion; } +static void GetCompileDefinitionsAndDirectories( + cmGeneratorTarget const* target, const std::string& config, + std::string& incs, std::string& defs) +{ + cmLocalGenerator* localGen = target->GetLocalGenerator(); + { + std::vector<std::string> includeDirs; + // Get the include dirs for this target, without stripping the implicit + // include dirs off, see + // https://gitlab.kitware.com/cmake/cmake/issues/13667 + localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false); + incs = cmJoin(includeDirs, ";"); + } + { + std::set<std::string> defines; + localGen->AddCompileDefinitions(defines, target, config, "CXX"); + defs += cmJoin(defines, ";"); + } +} + +static void AddDefinitionEscaped(cmMakefile* makefile, const char* key, + const std::string& value) +{ + makefile->AddDefinition(key, + cmOutputConverter::EscapeForCMake(value).c_str()); +} + +static void AddDefinitionEscaped(cmMakefile* makefile, const char* key, + const std::vector<std::string>& values) +{ + makefile->AddDefinition( + key, cmOutputConverter::EscapeForCMake(cmJoin(values, ";")).c_str()); +} + static void SetupSourceFiles(cmGeneratorTarget const* target, std::vector<std::string>& mocUicSources, std::vector<std::string>& mocUicHeaders, - std::vector<std::string>& skipMocList, - std::vector<std::string>& skipUicList) + std::vector<std::string>& mocSkipList, + std::vector<std::string>& uicSkipList) { cmMakefile* makefile = target->Target->GetMakefile(); std::vector<cmSourceFile*> srcFiles; target->GetConfigCommonSourceFiles(srcFiles); - const bool targetMoc = target->GetPropertyAsBool("AUTOMOC"); - const bool targetUic = target->GetPropertyAsBool("AUTOUIC"); + const bool mocTarget = target->GetPropertyAsBool("AUTOMOC"); + const bool uicTarget = target->GetPropertyAsBool("AUTOUIC"); cmFilePathChecksum fpathCheckSum(makefile); for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); @@ -131,22 +171,22 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, // Skip flags const bool skipAll = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")); - const bool skipMoc = + const bool mocSkip = skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC")); - const bool skipUic = + const bool uicSkip = skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC")); // Add file name to skip lists. // Do this even when the file is not added to the sources/headers lists // because the file name may be extracted from an other file when // processing - if (skipMoc) { - skipMocList.push_back(absFile); + if (mocSkip) { + mocSkipList.push_back(absFile); } - if (skipUic) { - skipUicList.push_back(absFile); + if (uicSkip) { + uicSkipList.push_back(absFile); } - if ((targetMoc && !skipMoc) || (targetUic && !skipUic)) { + if ((mocTarget && !mocSkip) || (uicTarget && !uicSkip)) { // Add file name to sources or headers list switch (fileType) { case cmSystemTools::CXX_FILE_FORMAT: @@ -162,100 +202,87 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, } } -static void GetCompileDefinitionsAndDirectories( - cmGeneratorTarget const* target, const std::string& config, - std::string& incs, std::string& defs) -{ - std::vector<std::string> includeDirs; - cmLocalGenerator* localGen = target->GetLocalGenerator(); - // Get the include dirs for this target, without stripping the implicit - // include dirs off, see https://gitlab.kitware.com/cmake/cmake/issues/13667 - localGen->GetIncludeDirectories(includeDirs, target, "CXX", config, false); - - incs = cmJoin(includeDirs, ";"); - - std::set<std::string> defines; - localGen->AddCompileDefinitions(defines, target, config, "CXX"); - - defs += cmJoin(defines, ";"); -} - static void MocSetupAutoTarget( cmGeneratorTarget const* target, const std::string& autogenTargetName, - std::vector<std::string> const& skipMoc, + const std::string& qtMajorVersion, + std::vector<std::string> const& mocSkipList, std::map<std::string, std::string>& configIncludes, std::map<std::string, std::string>& configDefines) { cmLocalGenerator* lg = target->GetLocalGenerator(); cmMakefile* makefile = target->Target->GetMakefile(); - const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); - std::string _moc_options = (tmp != CM_NULLPTR ? tmp : ""); - makefile->AddDefinition( - "_moc_options", cmOutputConverter::EscapeForCMake(_moc_options).c_str()); - makefile->AddDefinition( - "_skip_moc", - cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str()); - bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); - makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); - - std::string _moc_incs; - std::string _moc_compile_defs; - std::vector<std::string> configs; - const std::string& config = makefile->GetConfigurations(configs); - GetCompileDefinitionsAndDirectories(target, config, _moc_incs, - _moc_compile_defs); + AddDefinitionEscaped(makefile, "_moc_options", + GetSafeProperty(target, "AUTOMOC_MOC_OPTIONS")); + AddDefinitionEscaped(makefile, "_moc_skip", mocSkipList); + AddDefinitionEscaped(makefile, "_moc_relaxed_mode", + makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE") ? "TRUE" + : "FALSE"); - makefile->AddDefinition( - "_moc_incs", cmOutputConverter::EscapeForCMake(_moc_incs).c_str()); - makefile->AddDefinition( - "_moc_compile_defs", - cmOutputConverter::EscapeForCMake(_moc_compile_defs).c_str()); - - for (std::vector<std::string>::const_iterator li = configs.begin(); - li != configs.end(); ++li) { - std::string config_moc_incs; - std::string config_moc_compile_defs; - GetCompileDefinitionsAndDirectories(target, *li, config_moc_incs, - config_moc_compile_defs); - if (config_moc_incs != _moc_incs) { - configIncludes[*li] = cmOutputConverter::EscapeForCMake(config_moc_incs); - if (_moc_incs.empty()) { - _moc_incs = config_moc_incs; + // Moc includes and compile definitions + { + std::string _moc_incs; + std::string _moc_compile_defs; + std::vector<std::string> configs; + { + const std::string& config = makefile->GetConfigurations(configs); + GetCompileDefinitionsAndDirectories(target, config, _moc_incs, + _moc_compile_defs); + AddDefinitionEscaped(makefile, "_moc_incs", _moc_incs); + AddDefinitionEscaped(makefile, "_moc_compile_defs", _moc_compile_defs); + } + for (std::vector<std::string>::const_iterator li = configs.begin(); + li != configs.end(); ++li) { + std::string config_moc_incs; + std::string config_moc_compile_defs; + GetCompileDefinitionsAndDirectories(target, *li, config_moc_incs, + config_moc_compile_defs); + if (config_moc_incs != _moc_incs) { + configIncludes[*li] = + cmOutputConverter::EscapeForCMake(config_moc_incs); + if (_moc_incs.empty()) { + _moc_incs = config_moc_incs; + } } - } - if (config_moc_compile_defs != _moc_compile_defs) { - configDefines[*li] = - cmOutputConverter::EscapeForCMake(config_moc_compile_defs); - if (_moc_compile_defs.empty()) { - _moc_compile_defs = config_moc_compile_defs; + if (config_moc_compile_defs != _moc_compile_defs) { + configDefines[*li] = + cmOutputConverter::EscapeForCMake(config_moc_compile_defs); + if (_moc_compile_defs.empty()) { + _moc_compile_defs = config_moc_compile_defs; + } } } } - const char* qtVersion = makefile->GetDefinition("_target_qt_version"); - if (strcmp(qtVersion, "5") == 0) { - cmGeneratorTarget* qt5Moc = lg->FindGeneratorTargetToUse("Qt5::moc"); - if (!qt5Moc) { - cmSystemTools::Error("Qt5::moc target not found ", - autogenTargetName.c_str()); - return; + // Moc executable + { + std::string err; + const char* mocExec = CM_NULLPTR; + if (qtMajorVersion == "5") { + cmGeneratorTarget* qt5Moc = lg->FindGeneratorTargetToUse("Qt5::moc"); + if (qt5Moc != CM_NULLPTR) { + mocExec = qt5Moc->ImportedGetLocation(""); + } else { + err = "Qt5::moc target not found " + autogenTargetName; + } + } else if (qtMajorVersion == "4") { + cmGeneratorTarget* qt4Moc = lg->FindGeneratorTargetToUse("Qt4::moc"); + if (qt4Moc != CM_NULLPTR) { + mocExec = qt4Moc->ImportedGetLocation(""); + } else { + err = "Qt4::moc target not found " + autogenTargetName; + } + } else { + err = "The CMAKE_AUTOMOC feature supports only Qt 4 and Qt 5 "; + err += autogenTargetName; } - makefile->AddDefinition("_qt_moc_executable", - qt5Moc->ImportedGetLocation("")); - } else if (strcmp(qtVersion, "4") == 0) { - cmGeneratorTarget* qt4Moc = lg->FindGeneratorTargetToUse("Qt4::moc"); - if (!qt4Moc) { - cmSystemTools::Error("Qt4::moc target not found ", - autogenTargetName.c_str()); - return; + // Add definition or error + if (err.empty()) { + AddDefinitionEscaped(makefile, "_qt_moc_executable", + mocExec ? mocExec : ""); + } else { + cmSystemTools::Error(err.c_str()); } - makefile->AddDefinition("_qt_moc_executable", - qt4Moc->ImportedGetLocation("")); - } else { - cmSystemTools::Error("The CMAKE_AUTOMOC feature supports only Qt 4 and " - "Qt 5 ", - autogenTargetName.c_str()); } } @@ -268,126 +295,126 @@ static void UicGetOpts(cmGeneratorTarget const* target, } static void UicSetupAutoTarget( - cmGeneratorTarget const* target, std::vector<std::string> const& skipUic, + cmGeneratorTarget const* target, const std::string& qtMajorVersion, + std::vector<std::string> const& uicSkipList, std::map<std::string, std::string>& configUicOptions) { cmLocalGenerator* lg = target->GetLocalGenerator(); cmMakefile* makefile = target->Target->GetMakefile(); - std::set<std::string> skipped; - skipped.insert(skipUic.begin(), skipUic.end()); + AddDefinitionEscaped(makefile, "_uic_skip", uicSkipList); - makefile->AddDefinition( - "_skip_uic", - cmOutputConverter::EscapeForCMake(cmJoin(skipUic, ";")).c_str()); - - std::vector<cmSourceFile*> uiFilesWithOptions = - makefile->GetQtUiFilesWithOptions(); - - const char* qtVersion = makefile->GetDefinition("_target_qt_version"); - - std::string _uic_opts; - std::vector<std::string> configs; - const std::string& config = makefile->GetConfigurations(configs); - UicGetOpts(target, config, _uic_opts); - - if (!_uic_opts.empty()) { - _uic_opts = cmOutputConverter::EscapeForCMake(_uic_opts); - makefile->AddDefinition("_uic_target_options", _uic_opts.c_str()); - } - for (std::vector<std::string>::const_iterator li = configs.begin(); - li != configs.end(); ++li) { - std::string config_uic_opts; - UicGetOpts(target, *li, config_uic_opts); - if (config_uic_opts != _uic_opts) { - configUicOptions[*li] = - cmOutputConverter::EscapeForCMake(config_uic_opts); - if (_uic_opts.empty()) { - _uic_opts = config_uic_opts; + // Uic target options + { + std::string _uic_opts; + std::vector<std::string> configs; + UicGetOpts(target, makefile->GetConfigurations(configs), _uic_opts); + + AddDefinitionEscaped(makefile, "_uic_target_options", _uic_opts); + + for (std::vector<std::string>::const_iterator li = configs.begin(); + li != configs.end(); ++li) { + std::string config_uic_opts; + UicGetOpts(target, *li, config_uic_opts); + if (config_uic_opts != _uic_opts) { + configUicOptions[*li] = + cmOutputConverter::EscapeForCMake(config_uic_opts); + if (_uic_opts.empty()) { + _uic_opts = config_uic_opts; + } } } } - - std::string uiFileFiles; - std::string uiFileOptions; - const char* sep = ""; - - for (std::vector<cmSourceFile*>::const_iterator fileIt = - uiFilesWithOptions.begin(); - fileIt != uiFilesWithOptions.end(); ++fileIt) { - cmSourceFile* sf = *fileIt; - std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath()); - - if (!skipped.insert(absFile).second) { - continue; + // Uic files options + { + std::vector<std::string> uiFileFiles; + std::vector<std::string> uiFileOptions; + { + std::set<std::string> skipped; + skipped.insert(uicSkipList.begin(), uicSkipList.end()); + + const std::vector<cmSourceFile*> uiFilesWithOptions = + makefile->GetQtUiFilesWithOptions(); + for (std::vector<cmSourceFile*>::const_iterator fileIt = + uiFilesWithOptions.begin(); + fileIt != uiFilesWithOptions.end(); ++fileIt) { + cmSourceFile* sf = *fileIt; + const std::string absFile = + cmsys::SystemTools::GetRealPath(sf->GetFullPath()); + if (skipped.insert(absFile).second) { + // The file wasn't skipped + uiFileFiles.push_back(absFile); + { + std::string opts = sf->GetProperty("AUTOUIC_OPTIONS"); + cmSystemTools::ReplaceString(opts, ";", "@list_sep@"); + uiFileOptions.push_back(opts); + } + } + } } - uiFileFiles += sep; - uiFileFiles += absFile; - uiFileOptions += sep; - std::string opts = sf->GetProperty("AUTOUIC_OPTIONS"); - cmSystemTools::ReplaceString(opts, ";", "@list_sep@"); - uiFileOptions += opts; - sep = ";"; + AddDefinitionEscaped(makefile, "_qt_uic_options_files", uiFileFiles); + AddDefinitionEscaped(makefile, "_qt_uic_options_options", uiFileOptions); } - makefile->AddDefinition( - "_qt_uic_options_files", - cmOutputConverter::EscapeForCMake(uiFileFiles).c_str()); - makefile->AddDefinition( - "_qt_uic_options_options", - cmOutputConverter::EscapeForCMake(uiFileOptions).c_str()); - - std::string targetName = target->GetName(); - if (strcmp(qtVersion, "5") == 0) { - cmGeneratorTarget* qt5Uic = lg->FindGeneratorTargetToUse("Qt5::uic"); - if (!qt5Uic) { - // Project does not use Qt5Widgets, but has AUTOUIC ON anyway + // Uic executable + { + std::string err; + const char* uicExec = CM_NULLPTR; + if (qtMajorVersion == "5") { + cmGeneratorTarget* qt5Uic = lg->FindGeneratorTargetToUse("Qt5::uic"); + if (qt5Uic != CM_NULLPTR) { + uicExec = qt5Uic->ImportedGetLocation(""); + } else { + // Project does not use Qt5Widgets, but has AUTOUIC ON anyway + } + } else if (qtMajorVersion == "4") { + cmGeneratorTarget* qt4Uic = lg->FindGeneratorTargetToUse("Qt4::uic"); + if (qt4Uic != CM_NULLPTR) { + uicExec = qt4Uic->ImportedGetLocation(""); + } else { + err = "Qt4::uic target not found " + target->GetName(); + } } else { - makefile->AddDefinition("_qt_uic_executable", - qt5Uic->ImportedGetLocation("")); + err = "The CMAKE_AUTOUIC feature supports only Qt 4 and Qt 5 "; + err += target->GetName(); } - } else if (strcmp(qtVersion, "4") == 0) { - cmGeneratorTarget* qt4Uic = lg->FindGeneratorTargetToUse("Qt4::uic"); - if (!qt4Uic) { - cmSystemTools::Error("Qt4::uic target not found ", targetName.c_str()); - return; + // Add definition or error + if (err.empty()) { + AddDefinitionEscaped(makefile, "_qt_uic_executable", + uicExec ? uicExec : ""); + } else { + cmSystemTools::Error(err.c_str()); } - makefile->AddDefinition("_qt_uic_executable", - qt4Uic->ImportedGetLocation("")); - } else { - cmSystemTools::Error("The CMAKE_AUTOUIC feature supports only Qt 4 and " - "Qt 5 ", - targetName.c_str()); } } static std::string RccGetExecutable(cmGeneratorTarget const* target, const std::string& qtMajorVersion) { + std::string rccExec; cmLocalGenerator* lg = target->GetLocalGenerator(); - - std::string const& targetName = target->GetName(); if (qtMajorVersion == "5") { cmGeneratorTarget* qt5Rcc = lg->FindGeneratorTargetToUse("Qt5::rcc"); - if (!qt5Rcc) { - cmSystemTools::Error("Qt5::rcc target not found ", targetName.c_str()); - return std::string(); + if (qt5Rcc != CM_NULLPTR) { + rccExec = qt5Rcc->ImportedGetLocation(""); + } else { + cmSystemTools::Error("Qt5::rcc target not found ", + target->GetName().c_str()); } - return qt5Rcc->ImportedGetLocation(""); - } - if (qtMajorVersion == "4") { + } else if (qtMajorVersion == "4") { cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc"); - if (!qt4Rcc) { - cmSystemTools::Error("Qt4::rcc target not found ", targetName.c_str()); - return std::string(); + if (qt4Rcc != CM_NULLPTR) { + rccExec = qt4Rcc->ImportedGetLocation(""); + } else { + cmSystemTools::Error("Qt4::rcc target not found ", + target->GetName().c_str()); } - return qt4Rcc->ImportedGetLocation(""); + } else { + cmSystemTools::Error( + "The CMAKE_AUTORCC feature supports only Qt 4 and Qt 5 ", + target->GetName().c_str()); } - - cmSystemTools::Error("The CMAKE_AUTORCC feature supports only Qt 4 and " - "Qt 5 ", - targetName.c_str()); - return std::string(); + return rccExec; } static void RccMergeOptions(std::vector<std::string>& opts, @@ -397,26 +424,31 @@ static void RccMergeOptions(std::vector<std::string>& opts, static const char* valueOptions[] = { "name", "root", "compress", "threshold" }; std::vector<std::string> extraOpts; - for (std::vector<std::string>::const_iterator it = fileOpts.begin(); - it != fileOpts.end(); ++it) { + for (std::vector<std::string>::const_iterator fit = fileOpts.begin(); + fit != fileOpts.end(); ++fit) { std::vector<std::string>::iterator existingIt = - std::find(opts.begin(), opts.end(), *it); + std::find(opts.begin(), opts.end(), *fit); if (existingIt != opts.end()) { - const char* o = it->c_str(); - if (*o == '-') { - ++o; - } - if (isQt5 && *o == '-') { - ++o; + const char* optName = fit->c_str(); + if (*optName == '-') { + ++optName; + if (isQt5 && *optName == '-') { + ++optName; + } } - if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), - cmStrCmp(*it)) != cmArrayEnd(valueOptions)) { - assert(existingIt + 1 != opts.end()); - *(existingIt + 1) = *(it + 1); - ++it; + // Test if this is a value option and change the existing value + if ((optName != fit->c_str()) && + std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), + cmStrCmp(optName)) != cmArrayEnd(valueOptions)) { + const std::vector<std::string>::iterator existValueIt(existingIt + 1); + const std::vector<std::string>::const_iterator fileValueIt(fit + 1); + if ((existValueIt != opts.end()) && (fileValueIt != fileOpts.end())) { + *existValueIt = *fileValueIt; + ++fit; + } } } else { - extraOpts.push_back(*it); + extraOpts.push_back(*fit); } } opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); @@ -526,23 +558,20 @@ static bool RccListInputsQt4(cmSourceFile* sf, } cmsys::RegularExpression fileMatchRegex("(<file[^<]+)"); + cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)"); size_t offset = 0; while (fileMatchRegex.find(qrcContents.c_str() + offset)) { std::string qrcEntry = fileMatchRegex.match(1); - offset += qrcEntry.size(); - - cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)"); - fileReplaceRegex.find(qrcEntry); - std::string tag = fileReplaceRegex.match(1); - - qrcEntry = qrcEntry.substr(tag.size()); - + { + fileReplaceRegex.find(qrcEntry); + std::string tag = fileReplaceRegex.match(1); + qrcEntry = qrcEntry.substr(tag.size()); + } if (!cmSystemTools::FileIsFullPath(qrcEntry.c_str())) { qrcEntry = sf->GetLocation().GetDirectory() + "/" + qrcEntry; } - depends.push_back(qrcEntry); } return true; @@ -563,89 +592,69 @@ static bool RccListInputs(const std::string& qtMajorVersion, cmSourceFile* sf, static void RccSetupAutoTarget(cmGeneratorTarget const* target, const std::string& qtMajorVersion) { - std::string _rcc_files; - const char* sepRccFiles = ""; cmMakefile* makefile = target->Target->GetMakefile(); - - std::vector<cmSourceFile*> srcFiles; - target->GetConfigCommonSourceFiles(srcFiles); - - std::string qrcInputs; - const char* qrcInputsSep = ""; - - std::string rccFileFiles; - std::string rccFileOptions; - const char* optionSep = ""; - const bool qtMajorVersion5 = (qtMajorVersion == "5"); - - std::vector<std::string> rccOptions; + std::vector<std::string> _rcc_files; + std::vector<std::string> _rcc_inputs; + std::vector<std::string> rccFileFiles; + std::vector<std::string> rccFileOptions; + std::vector<std::string> rccOptionsTarget; if (const char* opts = target->GetProperty("AUTORCC_OPTIONS")) { - cmSystemTools::ExpandListArgument(opts, rccOptions); + cmSystemTools::ExpandListArgument(opts, rccOptionsTarget); } + std::vector<cmSourceFile*> srcFiles; + target->GetConfigCommonSourceFiles(srcFiles); for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin(); fileIt != srcFiles.end(); ++fileIt) { cmSourceFile* sf = *fileIt; - std::string ext = sf->GetExtension(); - if (ext == "qrc") { - std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath()); + if (sf->GetExtension() == "qrc") { const bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")) || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC")); - if (!skip) { - _rcc_files += sepRccFiles; - _rcc_files += absFile; - sepRccFiles = ";"; - - if (const char* prop = sf->GetProperty("AUTORCC_OPTIONS")) { - std::vector<std::string> optsVec; - cmSystemTools::ExpandListArgument(prop, optsVec); - RccMergeOptions(rccOptions, optsVec, qtMajorVersion5); - } - - if (!rccOptions.empty()) { - rccFileFiles += optionSep; - rccFileFiles += absFile; - rccFileOptions += optionSep; - } - const char* listSep = ""; - for (std::vector<std::string>::const_iterator it = rccOptions.begin(); - it != rccOptions.end(); ++it) { - rccFileOptions += listSep; - rccFileOptions += *it; - listSep = "@list_sep@"; + const std::string absFile = + cmsys::SystemTools::GetRealPath(sf->GetFullPath()); + // qrc file + _rcc_files.push_back(absFile); + // qrc file entries + { + std::string entriesList; + if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { + std::vector<std::string> depends; + if (RccListInputs(qtMajorVersion, sf, target, depends)) { + entriesList = cmJoin(depends, "@list_sep@"); + } else { + return; + } + } + _rcc_inputs.push_back(entriesList); } - optionSep = ";"; - - std::string entriesList; - if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) { - std::vector<std::string> depends; - if (RccListInputs(qtMajorVersion, sf, target, depends)) { - entriesList = cmJoin(depends, "@list_sep@"); - } else { - return; + // rcc options for this qrc file + { + // Merged target and file options + std::vector<std::string> rccOptions(rccOptionsTarget); + if (const char* prop = sf->GetProperty("AUTORCC_OPTIONS")) { + std::vector<std::string> optsVec; + cmSystemTools::ExpandListArgument(prop, optsVec); + RccMergeOptions(rccOptions, optsVec, qtMajorVersion5); + } + // Only store non empty options lists + if (!rccOptions.empty()) { + rccFileFiles.push_back(absFile); + rccFileOptions.push_back(cmJoin(rccOptions, "@list_sep@")); } } - qrcInputs += qrcInputsSep; - qrcInputs += entriesList; - qrcInputsSep = ";"; } } } - makefile->AddDefinition( - "_rcc_inputs", cmOutputConverter::EscapeForCMake(qrcInputs).c_str()); - makefile->AddDefinition( - "_rcc_files", cmOutputConverter::EscapeForCMake(_rcc_files).c_str()); - makefile->AddDefinition( - "_rcc_options_files", - cmOutputConverter::EscapeForCMake(rccFileFiles).c_str()); - makefile->AddDefinition( - "_rcc_options_options", - cmOutputConverter::EscapeForCMake(rccFileOptions).c_str()); - makefile->AddDefinition("_qt_rcc_executable", - RccGetExecutable(target, qtMajorVersion).c_str()); + + AddDefinitionEscaped(makefile, "_rcc_files", _rcc_files); + AddDefinitionEscaped(makefile, "_rcc_inputs", _rcc_inputs); + AddDefinitionEscaped(makefile, "_rcc_options_files", rccFileFiles); + AddDefinitionEscaped(makefile, "_rcc_options_options", rccFileOptions); + AddDefinitionEscaped(makefile, "_qt_rcc_executable", + RccGetExecutable(target, qtMajorVersion)); } void cmQtAutoGeneratorInitializer::InitializeAutogenSources( @@ -872,47 +881,42 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( cmMakefile::ScopePushPop varScope(makefile); static_cast<void>(varScope); - // create a custom target for running generators at buildtime: - const std::string autogenTargetName = GetAutogenTargetName(target); - const std::string qtMajorVersion = GetQtMajorVersion(target); - - makefile->AddDefinition( - "_moc_target_name", - cmOutputConverter::EscapeForCMake(autogenTargetName).c_str()); - makefile->AddDefinition( - "_origin_target_name", - cmOutputConverter::EscapeForCMake(target->GetName()).c_str()); - makefile->AddDefinition("_target_qt_version", qtMajorVersion.c_str()); - - std::vector<std::string> mocUicSources; - std::vector<std::string> mocUicHeaders; - std::vector<std::string> skipMoc; - std::vector<std::string> skipUic; std::map<std::string, std::string> configMocIncludes; std::map<std::string, std::string> configMocDefines; std::map<std::string, std::string> configUicOptions; + { + // create a custom target for running generators at buildtime: + const std::string autogenTargetName = GetAutogenTargetName(target); + const std::string qtMajorVersion = GetQtMajorVersion(target); - if (target->GetPropertyAsBool("AUTOMOC") || - target->GetPropertyAsBool("AUTOUIC") || - target->GetPropertyAsBool("AUTORCC")) { - SetupSourceFiles(target, mocUicSources, mocUicHeaders, skipMoc, skipUic); - } - makefile->AddDefinition( - "_moc_uic_sources", - cmOutputConverter::EscapeForCMake(cmJoin(mocUicSources, ";")).c_str()); - makefile->AddDefinition( - "_moc_uic_headers", - cmOutputConverter::EscapeForCMake(cmJoin(mocUicHeaders, ";")).c_str()); + AddDefinitionEscaped(makefile, "_autogen_target_name", autogenTargetName); + AddDefinitionEscaped(makefile, "_origin_target_name", target->GetName()); + AddDefinitionEscaped(makefile, "_qt_version_major", qtMajorVersion); - if (target->GetPropertyAsBool("AUTOMOC")) { - MocSetupAutoTarget(target, autogenTargetName, skipMoc, configMocIncludes, - configMocDefines); - } - if (target->GetPropertyAsBool("AUTOUIC")) { - UicSetupAutoTarget(target, skipUic, configUicOptions); - } - if (target->GetPropertyAsBool("AUTORCC")) { - RccSetupAutoTarget(target, qtMajorVersion); + std::vector<std::string> _sources; + std::vector<std::string> _headers; + std::vector<std::string> mocSkipList; + std::vector<std::string> uicSkipList; + + if (target->GetPropertyAsBool("AUTOMOC") || + target->GetPropertyAsBool("AUTOUIC") || + target->GetPropertyAsBool("AUTORCC")) { + SetupSourceFiles(target, _sources, _headers, mocSkipList, uicSkipList); + } + AddDefinitionEscaped(makefile, "_sources", _sources); + AddDefinitionEscaped(makefile, "_headers", _headers); + + if (target->GetPropertyAsBool("AUTOMOC")) { + MocSetupAutoTarget(target, autogenTargetName, qtMajorVersion, + mocSkipList, configMocIncludes, configMocDefines); + } + if (target->GetPropertyAsBool("AUTOUIC")) { + UicSetupAutoTarget(target, qtMajorVersion, uicSkipList, + configUicOptions); + } + if (target->GetPropertyAsBool("AUTORCC")) { + RccSetupAutoTarget(target, qtMajorVersion); + } } // Generate config file @@ -924,7 +928,7 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( makefile->ConfigureFile(inputFile.c_str(), outputFile.c_str(), false, true, false); - // Append custom definitions to config file + // Append custom config definitions to info file if (!configMocDefines.empty() || !configMocIncludes.empty() || !configUicOptions.empty()) { @@ -946,33 +950,34 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( error += outputFile; error += " for writing."; cmSystemTools::Error(error.c_str()); - return; - } - if (!configMocDefines.empty()) { - for (std::map<std::string, std::string>::iterator - it = configMocDefines.begin(), - end = configMocDefines.end(); - it != end; ++it) { - infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first << " " - << it->second << ")\n"; + } else { + infoFile << "# Configuration specific options\n"; + if (!configMocDefines.empty()) { + for (std::map<std::string, std::string>::iterator + it = configMocDefines.begin(), + end = configMocDefines.end(); + it != end; ++it) { + infoFile << "set(AM_MOC_COMPILE_DEFINITIONS_" << it->first << " " + << it->second << ")\n"; + } } - } - if (!configMocIncludes.empty()) { - for (std::map<std::string, std::string>::iterator - it = configMocIncludes.begin(), - end = configMocIncludes.end(); - it != end; ++it) { - infoFile << "set(AM_MOC_INCLUDES_" << it->first << " " << it->second - << ")\n"; + if (!configMocIncludes.empty()) { + for (std::map<std::string, std::string>::iterator + it = configMocIncludes.begin(), + end = configMocIncludes.end(); + it != end; ++it) { + infoFile << "set(AM_MOC_INCLUDES_" << it->first << " " << it->second + << ")\n"; + } } - } - if (!configUicOptions.empty()) { - for (std::map<std::string, std::string>::iterator - it = configUicOptions.begin(), - end = configUicOptions.end(); - it != end; ++it) { - infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first << " " - << it->second << ")\n"; + if (!configUicOptions.empty()) { + for (std::map<std::string, std::string>::iterator + it = configUicOptions.begin(), + end = configUicOptions.end(); + it != end; ++it) { + infoFile << "set(AM_UIC_TARGET_OPTIONS_" << it->first << " " + << it->second << ")\n"; + } } } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 1d6972b..d51efb4 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -7,13 +7,14 @@ #include <cmConfigure.h> #include <cmsys/FStream.hxx> #include <cmsys/Terminal.h> -#include <iostream> +#include <list> #include <sstream> #include <stdlib.h> #include <string.h> #include <utility> #include "cmAlgorithms.h" +#include "cmFilePathChecksum.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmOutputConverter.h" @@ -29,9 +30,9 @@ // -- Static variables -static const char* MocOldSettingsKey = "AM_MOC_OLD_SETTINGS"; -static const char* UicOldSettingsKey = "AM_UIC_OLD_SETTINGS"; -static const char* RccOldSettingsKey = "AM_RCC_OLD_SETTINGS"; +static const char* SettingsKeyMoc = "AM_MOC_OLD_SETTINGS"; +static const char* SettingsKeyUic = "AM_UIC_OLD_SETTINGS"; +static const char* SettingsKeyRcc = "AM_RCC_OLD_SETTINGS"; // -- Static functions @@ -51,7 +52,7 @@ static std::string GetConfigDefinition(cmMakefile* makefile, return makefile->GetSafeDefinition(key); } -static std::string OldSettingsFile(const std::string& targetDirectory) +static std::string SettingsFile(const std::string& targetDirectory) { std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); cmSystemTools::ConvertToUnixSlashes(filename); @@ -59,40 +60,19 @@ static std::string OldSettingsFile(const std::string& targetDirectory) return filename; } -static std::string FindMatchingHeader( - const std::string& absPath, const std::string& mocSubDir, - const std::string& basename, - const std::vector<std::string>& headerExtensions) +inline static bool SettingsMatch(cmMakefile* makefile, const char* key, + const std::string& value) { - std::string header; - for (std::vector<std::string>::const_iterator ext = headerExtensions.begin(); - ext != headerExtensions.end(); ++ext) { - std::string sourceFilePath = absPath + basename + "." + (*ext); - if (cmsys::SystemTools::FileExists(sourceFilePath.c_str())) { - header = sourceFilePath; - break; - } - // Try subdirectory instead - if (!mocSubDir.empty()) { - sourceFilePath = mocSubDir + basename + "." + (*ext); - if (cmsys::SystemTools::FileExists(sourceFilePath.c_str())) { - header = sourceFilePath; - break; - } - } - } - - return header; + return (value == makefile->GetSafeDefinition(key)); } -static std::string ExtractSubDir(const std::string& absPath, - const std::string& currentMoc) +static void SettingWrite(std::ostream& ostr, const char* key, + const std::string& value) { - std::string subDir; - if (currentMoc.find_first_of('/') != std::string::npos) { - subDir = absPath + cmsys::SystemTools::GetFilenamePath(currentMoc) + '/'; + if (!value.empty()) { + ostr << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value) + << ")\n"; } - return subDir; } static bool FileNameIsUnique(const std::string& filePath, @@ -140,13 +120,19 @@ static bool ListContains(const std::vector<std::string>& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } -static std::string JoinOptions(const std::map<std::string, std::string>& opts) +static std::string JoinOptionsList(const std::vector<std::string>& opts) +{ + return cmOutputConverter::EscapeForCMake(cmJoin(opts, ";")); +} + +static std::string JoinOptionsMap( + const std::map<std::string, std::string>& opts) { std::string result; for (std::map<std::string, std::string>::const_iterator it = opts.begin(); it != opts.end(); ++it) { if (it != opts.begin()) { - result += "%%%"; + result += "@list_sep@"; } result += it->first; result += "==="; @@ -214,9 +200,9 @@ cmQtAutoGenerators::cmQtAutoGenerators() , RunMocFailed(false) , RunUicFailed(false) , RunRccFailed(false) - , GenerateMocAll(false) - , GenerateUicAll(false) - , GenerateRccAll(false) + , GenerateAllMoc(false) + , GenerateAllUic(false) + , GenerateAllRcc(false) { std::string colorEnv; @@ -229,9 +215,12 @@ cmQtAutoGenerators::cmQtAutoGenerators() } } + this->MacroFilters[0].first = "Q_OBJECT"; + this->MacroFilters[0].second.compile("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); + this->MacroFilters[1].first = "Q_GADGET"; + this->MacroFilters[1].second.compile("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); + // Precompile regular expressions - this->RegExpQObject.compile("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); - this->RegExpQGadget.compile("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); this->RegExpMocInclude.compile( "[\n][ \t]*#[ \t]*include[ \t]+" "[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]"); @@ -259,16 +248,16 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, return false; } // Read old settings - this->OldSettingsReadFile(mf.get(), targetDirectory); + this->SettingsFileRead(mf.get(), targetDirectory); // Init and run - this->Init(); + this->Init(mf.get()); if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") { - if (!this->RunAutogen(mf.get())) { + if (!this->RunAutogen()) { return false; } } // Write latest settings - if (!this->OldSettingsWriteFile(targetDirectory)) { + if (!this->SettingsFileWrite(targetDirectory)) { return false; } return true; @@ -319,17 +308,20 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( this->Headers); // - Moc - cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_MOC"), - this->SkipMoc); - this->MocCompileDefinitionsStr = - GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config); - this->MocIncludesStr = - GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config); - this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS"); + cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_MOC_SKIP"), + this->MocSkipList); + cmSystemTools::ExpandListArgument( + GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config), + this->MocDefinitions); + cmSystemTools::ExpandListArgument( + GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config), + this->MocIncludePaths); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_MOC_OPTIONS"), this->MocOptions); // - Uic - cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_UIC"), - this->SkipUic); + cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_UIC_SKIP"), + this->UicSkipList); cmSystemTools::ExpandListArgument( GetConfigDefinition(makefile, "AM_UIC_TARGET_OPTIONS", config), this->UicTargetOptions); @@ -413,110 +405,75 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( return true; } -std::string cmQtAutoGenerators::MocSettingsStringCompose() +void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, + const std::string& targetDirectory) { - std::string res; - res += this->MocCompileDefinitionsStr; - res += " ~~~ "; - res += this->MocIncludesStr; - res += " ~~~ "; - res += this->MocOptionsStr; - res += " ~~~ "; - res += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; - res += " ~~~ "; - return res; -} - -std::string cmQtAutoGenerators::UicSettingsStringCompose() -{ - std::string res; - res += cmJoin(this->UicTargetOptions, "@osep@"); - res += " ~~~ "; - res += JoinOptions(this->UicOptions); - res += " ~~~ "; - return res; -} - -std::string cmQtAutoGenerators::RccSettingsStringCompose() -{ - std::string res; - res += JoinOptions(this->RccOptions); - res += " ~~~ "; - return res; -} + // Compose current settings strings + if (this->MocEnabled()) { + std::string& str = this->SettingsStringMoc; + str += JoinOptionsList(this->MocDefinitions); + str += " ~~~ "; + str += JoinOptionsList(this->MocIncludePaths); + str += " ~~~ "; + str += JoinOptionsList(this->MocOptions); + str += " ~~~ "; + str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; + str += " ~~~ "; + } + if (this->UicEnabled()) { + std::string& str = this->SettingsStringUic; + str += JoinOptionsList(this->UicTargetOptions); + str += " ~~~ "; + str += JoinOptionsMap(this->UicOptions); + str += " ~~~ "; + } + if (this->RccEnabled()) { + std::string& str = this->SettingsStringRcc; + str += JoinOptionsMap(this->RccOptions); + str += " ~~~ "; + } -void cmQtAutoGenerators::OldSettingsReadFile( - cmMakefile* makefile, const std::string& targetDirectory) -{ - if (!this->MocExecutable.empty() || !this->UicExecutable.empty() || - !this->RccExecutable.empty()) { - // Compose current settings strings - this->MocSettingsString = this->MocSettingsStringCompose(); - this->UicSettingsString = this->UicSettingsStringCompose(); - this->RccSettingsString = this->RccSettingsStringCompose(); - - // Read old settings - const std::string filename = OldSettingsFile(targetDirectory); - if (makefile->ReadListFile(filename.c_str())) { - if (!this->MocExecutable.empty()) { - const std::string sol = makefile->GetSafeDefinition(MocOldSettingsKey); - if (sol != this->MocSettingsString) { - this->GenerateMocAll = true; - } - } - if (!this->UicExecutable.empty()) { - const std::string sol = makefile->GetSafeDefinition(UicOldSettingsKey); - if (sol != this->UicSettingsString) { - this->GenerateUicAll = true; - } - } - if (!this->RccExecutable.empty()) { - const std::string sol = makefile->GetSafeDefinition(RccOldSettingsKey); - if (sol != this->RccSettingsString) { - this->GenerateRccAll = true; - } - } - // In case any setting changed remove the old settings file. - // This triggers a full rebuild on the next run if the current - // build is aborted before writing the current settings in the end. - if (this->GenerateMocAll || this->GenerateUicAll || - this->GenerateRccAll) { - cmSystemTools::RemoveFile(filename); - } - } else { - // If the file could not be read re-generate everythiung. - this->GenerateMocAll = true; - this->GenerateUicAll = true; - this->GenerateRccAll = true; + // Read old settings + const std::string filename = SettingsFile(targetDirectory); + if (makefile->ReadListFile(filename.c_str())) { + if (!SettingsMatch(makefile, SettingsKeyMoc, this->SettingsStringMoc)) { + this->GenerateAllMoc = true; + } + if (!SettingsMatch(makefile, SettingsKeyUic, this->SettingsStringUic)) { + this->GenerateAllUic = true; + } + if (!SettingsMatch(makefile, SettingsKeyRcc, this->SettingsStringRcc)) { + this->GenerateAllRcc = true; } + // In case any setting changed remove the old settings file. + // This triggers a full rebuild on the next run if the current + // build is aborted before writing the current settings in the end. + if (this->GenerateAllAny()) { + cmSystemTools::RemoveFile(filename); + } + } else { + // If the file could not be read re-generate everythiung. + this->GenerateAllMoc = true; + this->GenerateAllUic = true; + this->GenerateAllRcc = true; } } -bool cmQtAutoGenerators::OldSettingsWriteFile( - const std::string& targetDirectory) +bool cmQtAutoGenerators::SettingsFileWrite(const std::string& targetDirectory) { bool success = true; // Only write if any setting changed - if (this->GenerateMocAll || this->GenerateUicAll || this->GenerateRccAll) { - const std::string filename = OldSettingsFile(targetDirectory); + if (this->GenerateAllAny()) { + const std::string filename = SettingsFile(targetDirectory); + if (this->Verbose) { + this->LogInfo("AutoGen: Writing settings file " + filename); + } cmsys::ofstream outfile; outfile.open(filename.c_str(), std::ios::trunc); if (outfile) { - if (!this->MocExecutable.empty()) { - outfile << "set(" << MocOldSettingsKey << " " - << cmOutputConverter::EscapeForCMake(this->MocSettingsString) - << ")\n"; - } - if (!this->UicExecutable.empty()) { - outfile << "set(" << UicOldSettingsKey << " " - << cmOutputConverter::EscapeForCMake(this->UicSettingsString) - << ")\n"; - } - if (!this->RccExecutable.empty()) { - outfile << "set(" << RccOldSettingsKey << " " - << cmOutputConverter::EscapeForCMake(this->RccSettingsString) - << ")\n"; - } + SettingWrite(outfile, SettingsKeyMoc, this->SettingsStringMoc); + SettingWrite(outfile, SettingsKeyUic, this->SettingsStringUic); + SettingWrite(outfile, SettingsKeyRcc, this->SettingsStringRcc); success = outfile.good(); outfile.close(); } else { @@ -525,8 +482,8 @@ bool cmQtAutoGenerators::OldSettingsWriteFile( cmSystemTools::RemoveFile(filename); { std::ostringstream err; - err << "AutoGen: Error: Writing old settings file failed: " << filename - << std::endl; + err << "AutoGen: Error: Writing old settings file failed: " + << filename; this->LogError(err.str()); } } @@ -534,144 +491,146 @@ bool cmQtAutoGenerators::OldSettingsWriteFile( return success; } -void cmQtAutoGenerators::Init() +void cmQtAutoGenerators::Init(cmMakefile* makefile) { this->AutogenBuildSubDir = this->AutogenTargetName; this->AutogenBuildSubDir += "/"; - this->OutMocCppFilenameRel = this->AutogenBuildSubDir; - this->OutMocCppFilenameRel += "moc_compilation.cpp"; + this->MocCppFilenameRel = this->AutogenBuildSubDir; + this->MocCppFilenameRel += "moc_compilation.cpp"; - this->OutMocCppFilenameAbs = - this->CurrentBinaryDir + this->OutMocCppFilenameRel; + this->MocCppFilenameAbs = this->CurrentBinaryDir + this->MocCppFilenameRel; // Init file path checksum generator fpathCheckSum.setupParentDirs(this->CurrentSourceDir, this->CurrentBinaryDir, this->ProjectSourceDir, this->ProjectBinaryDir); - std::vector<std::string> cdefList; - cmSystemTools::ExpandListArgument(this->MocCompileDefinitionsStr, cdefList); - for (std::vector<std::string>::const_iterator it = cdefList.begin(); - it != cdefList.end(); ++it) { - this->MocDefinitions.push_back("-D" + (*it)); - } - - cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions); - - std::vector<std::string> incPaths; - cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths); - - std::set<std::string> frameworkPaths; - for (std::vector<std::string>::const_iterator it = incPaths.begin(); - it != incPaths.end(); ++it) { - const std::string& path = *it; - this->MocIncludes.push_back("-I" + path); - if (cmHasLiteralSuffix(path, ".framework/Headers")) { - // Go up twice to get to the framework root - std::vector<std::string> pathComponents; - cmsys::SystemTools::SplitPath(path, pathComponents); - std::string frameworkPath = cmsys::SystemTools::JoinPath( - pathComponents.begin(), pathComponents.end() - 2); - frameworkPaths.insert(frameworkPath); - } - } - - for (std::set<std::string>::const_iterator it = frameworkPaths.begin(); - it != frameworkPaths.end(); ++it) { - this->MocIncludes.push_back("-F"); - this->MocIncludes.push_back(*it); - } + // Acquire header extensions + this->HeaderExtensions = makefile->GetCMakeInstance()->GetHeaderExtensions(); + // Sort include directories on demand if (this->IncludeProjectDirsBefore) { - const std::string binDir = "-I" + this->ProjectBinaryDir; - const std::string srcDir = "-I" + this->ProjectSourceDir; - - std::list<std::string> sortedMocIncludes; - std::list<std::string>::iterator it = this->MocIncludes.begin(); - while (it != this->MocIncludes.end()) { - if (cmsys::SystemTools::StringStartsWith(*it, binDir.c_str())) { - sortedMocIncludes.push_back(*it); - it = this->MocIncludes.erase(it); - } else { - ++it; + // Move strings to temporary list + std::list<std::string> includes; + includes.insert(includes.end(), this->MocIncludePaths.begin(), + this->MocIncludePaths.end()); + this->MocIncludePaths.clear(); + this->MocIncludePaths.reserve(includes.size()); + // Append project directories only + { + const char* movePaths[2] = { this->ProjectBinaryDir.c_str(), + this->ProjectSourceDir.c_str() }; + for (const char* const* mpit = cmArrayBegin(movePaths); + mpit != cmArrayEnd(movePaths); ++mpit) { + std::list<std::string>::iterator it = includes.begin(); + while (it != includes.end()) { + const std::string& path = *it; + if (cmsys::SystemTools::StringStartsWith(path, *mpit)) { + this->MocIncludePaths.push_back(path); + it = includes.erase(it); + } else { + ++it; + } + } } } - it = this->MocIncludes.begin(); - while (it != this->MocIncludes.end()) { - if (cmsys::SystemTools::StringStartsWith(*it, srcDir.c_str())) { - sortedMocIncludes.push_back(*it); - it = this->MocIncludes.erase(it); - } else { - ++it; + // Append remaining directories + this->MocIncludePaths.insert(this->MocIncludePaths.end(), includes.begin(), + includes.end()); + } + // Compose moc includes list + { + std::set<std::string> frameworkPaths; + for (std::vector<std::string>::const_iterator it = + this->MocIncludePaths.begin(); + it != this->MocIncludePaths.end(); ++it) { + const std::string& path = *it; + this->MocIncludes.push_back("-I" + path); + // Extract framework path + if (cmHasLiteralSuffix(path, ".framework/Headers")) { + // Go up twice to get to the framework root + std::vector<std::string> pathComponents; + cmsys::SystemTools::SplitPath(path, pathComponents); + std::string frameworkPath = cmsys::SystemTools::JoinPath( + pathComponents.begin(), pathComponents.end() - 2); + frameworkPaths.insert(frameworkPath); } } - sortedMocIncludes.insert(sortedMocIncludes.end(), - this->MocIncludes.begin(), - this->MocIncludes.end()); - this->MocIncludes = sortedMocIncludes; + // Append framework includes + for (std::set<std::string>::const_iterator it = frameworkPaths.begin(); + it != frameworkPaths.end(); ++it) { + this->MocIncludes.push_back("-F"); + this->MocIncludes.push_back(*it); + } + } + + // Insert MocDependFilter for Q_PLUGIN_METADATA + if (QtMajorVersion != "4") { + MocDependFilter filter; + filter.key = "Q_PLUGIN_METADATA"; + filter.regExp.compile("[\n][ \t]*" + "Q_PLUGIN_METADATA[ \t]*\\(" + "[^\\)]*FILE[ \t]*\"([^\"]+)\""); + this->MocDependFilters.push_back(filter); } } -bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) +bool cmQtAutoGenerators::RunAutogen() { // the program goes through all .cpp files to see which moc files are // included. It is not really interesting how the moc file is named, but // what file the moc is created from. Once a moc is included the same moc // may not be included in the moc_compilation.cpp file anymore. OTOH if // there's a header containing Q_OBJECT where no corresponding moc file - // is included anywhere a moc_<filename>.cpp file is created and included in - // the moc_compilation.cpp file. + // is included anywhere a moc_<filename>.cpp file is created and included + // in the moc_compilation.cpp file. // key = moc source filepath, value = moc output filepath - std::map<std::string, std::string> includedMocs; - std::map<std::string, std::string> notIncludedMocs; - std::map<std::string, std::vector<std::string> > includedUis; + std::map<std::string, std::string> mocsIncluded; + std::map<std::string, std::string> mocsNotIncluded; + std::map<std::string, std::set<std::string> > mocDepends; + std::map<std::string, std::vector<std::string> > uisIncluded; // collects all headers which may need to be mocced - std::set<std::string> headerFilesMoc; - std::set<std::string> headerFilesUic; + std::set<std::string> mocHeaderFiles; + std::set<std::string> uicHeaderFiles; // Parse sources - { - const std::vector<std::string>& headerExtensions = - makefile->GetCMakeInstance()->GetHeaderExtensions(); - - for (std::vector<std::string>::const_iterator it = this->Sources.begin(); - it != this->Sources.end(); ++it) { - const std::string& absFilename = *it; - // Parse source file for MOC/UIC - if (!this->ParseSourceFile(absFilename, headerExtensions, includedMocs, - includedUis, this->MocRelaxedMode)) { - return false; - } - // Find additional headers - this->SearchHeadersForSourceFile(absFilename, headerExtensions, - headerFilesMoc, headerFilesUic); + for (std::vector<std::string>::const_iterator it = this->Sources.begin(); + it != this->Sources.end(); ++it) { + const std::string& absFilename = cmsys::SystemTools::GetRealPath(*it); + // Parse source file for MOC/UIC + if (!this->ParseSourceFile(absFilename, mocsIncluded, mocDepends, + uisIncluded, this->MocRelaxedMode)) { + return false; } + // Find additional headers + this->SearchHeadersForSourceFile(absFilename, mocHeaderFiles, + uicHeaderFiles); } // Parse headers for (std::vector<std::string>::const_iterator it = this->Headers.begin(); it != this->Headers.end(); ++it) { - const std::string& headerName = *it; - if (!this->MocSkipTest(headerName)) { - headerFilesMoc.insert(headerName); + const std::string& headerName = cmsys::SystemTools::GetRealPath(*it); + if (!this->MocSkip(headerName)) { + mocHeaderFiles.insert(headerName); } - if (!this->UicSkipTest(headerName)) { - headerFilesUic.insert(headerName); + if (!this->UicSkip(headerName)) { + uicHeaderFiles.insert(headerName); } } - this->ParseHeaders(headerFilesMoc, headerFilesUic, includedMocs, - notIncludedMocs, includedUis); + this->ParseHeaders(mocHeaderFiles, uicHeaderFiles, mocsIncluded, + mocsNotIncluded, mocDepends, uisIncluded); // Generate files - if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) { + if (!this->MocGenerateAll(mocsIncluded, mocsNotIncluded, mocDepends)) { return false; } - if (!this->UicGenerateAll(includedUis)) { + if (!this->UicGenerateAll(uisIncluded)) { return false; } - if (!this->QrcGenerateAll()) { + if (!this->RccGenerateAll()) { return false; } @@ -682,35 +641,73 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) * @brief Tests if the C++ content requires moc processing * @return True if moc is required */ -bool cmQtAutoGenerators::MocRequired(const std::string& text, - std::string& macroName) +bool cmQtAutoGenerators::MocRequired(const std::string& contentText, + std::string* macroName) { - // Run a simple check before an expensive regular expression check - if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) { - if (this->RegExpQObject.find(text)) { - macroName = "Q_OBJECT"; - return true; + for (unsigned int ii = 0; ii != cmArraySize(this->MacroFilters); ++ii) { + MacroFilter& filter = this->MacroFilters[ii]; + // Run a simple find string operation before the expensive + // regular expression check + if (contentText.find(filter.first) != std::string::npos) { + if (filter.second.find(contentText)) { + // Return macro name on demand + if (macroName != CM_NULLPTR) { + *macroName = filter.first; + } + return true; + } } } - if (strstr(text.c_str(), "Q_GADGET") != CM_NULLPTR) { - if (this->RegExpQGadget.find(text)) { - macroName = "Q_GADGET"; - return true; + return false; +} + +void cmQtAutoGenerators::MocFindDepends( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::set<std::string> >& mocDepends) +{ + for (std::vector<MocDependFilter>::iterator fit = + this->MocDependFilters.begin(); + fit != this->MocDependFilters.end(); ++fit) { + MocDependFilter& filter = *fit; + // Run a simple find string operation before the expensive + // regular expression check + if (contentText.find(filter.key) != std::string::npos) { + // Run regular expression check loop + const char* contentChars = contentText.c_str(); + while (filter.regExp.find(contentChars)) { + // Evaluate match + const std::string match = filter.regExp.match(1); + if (!match.empty()) { + // Find the dependency file + const std::string incFile = + this->FindIncludedFile(absFilename, match); + if (!incFile.empty()) { + mocDepends[absFilename].insert(incFile); + if (this->Verbose) { + this->LogInfo("AutoMoc: Found dependency:\n \"" + absFilename + + "\"\n \"" + incFile + "\""); + } + } else { + this->LogWarning("AutoMoc: Warning: \"" + absFilename + "\"\n" + + "Could not find dependency file \"" + match + + "\""); + } + } + contentChars += filter.regExp.end(); + } } } - return false; } /** * @brief Tests if the file should be ignored for moc scanning * @return True if the file should be ignored */ -bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename) +bool cmQtAutoGenerators::MocSkip(const std::string& absFilename) const { - // Test if moc scanning is enabled - if (!this->MocExecutable.empty()) { + if (this->MocEnabled()) { // Test if the file name is on the skip list - if (!ListContains(this->SkipMoc, absFilename)) { + if (!ListContains(this->MocSkipList, absFilename)) { return false; } } @@ -720,12 +717,11 @@ bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename) /** * @brief Tests if the file name is in the skip list */ -bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename) +bool cmQtAutoGenerators::UicSkip(const std::string& absFilename) const { - // Test if uic scanning is enabled - if (!this->UicExecutable.empty()) { + if (this->UicEnabled()) { // Test if the file name is on the skip list - if (!ListContains(this->SkipUic, absFilename)) { + if (!ListContains(this->UicSkipList, absFilename)) { return false; } } @@ -737,44 +733,40 @@ bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename) */ bool cmQtAutoGenerators::ParseSourceFile( const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::vector<std::string> >& includedUis, bool relaxed) + std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, + std::map<std::string, std::vector<std::string> >& uisIncluded, bool relaxed) { bool success = true; - const std::string contentsString = ReadAll(absFilename); - if (contentsString.empty()) { - std::ostringstream err; - err << "AutoGen: Warning: " << absFilename << "\n" + const std::string contentText = ReadAll(absFilename); + if (contentText.empty()) { + std::ostringstream ost; + ost << "AutoGen: Warning: " << absFilename << "\n" << "The file is empty\n"; - this->LogWarning(err.str()); + this->LogWarning(ost.str()); } else { // Parse source contents for MOC - if (success && !this->MocSkipTest(absFilename)) { - success = this->ParseContentForMoc( - absFilename, contentsString, headerExtensions, includedMocs, relaxed); + if (success && !this->MocSkip(absFilename)) { + success = this->MocParseSourceContent(absFilename, contentText, + mocsIncluded, mocDepends, relaxed); } // Parse source contents for UIC - if (success && !this->UicSkipTest(absFilename)) { - this->ParseContentForUic(absFilename, contentsString, includedUis); + if (success && !this->UicSkip(absFilename)) { + this->UicParseContent(absFilename, contentText, uisIncluded); } } return success; } -void cmQtAutoGenerators::ParseContentForUic( - const std::string& absFilename, const std::string& contentsString, - std::map<std::string, std::vector<std::string> >& includedUis) +void cmQtAutoGenerators::UicParseContent( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::vector<std::string> >& uisIncluded) { - // Process if (this->Verbose) { - std::ostringstream err; - err << "AutoUic: Checking " << absFilename << "\n"; - this->LogInfo(err.str()); + this->LogInfo("AutoUic: Checking " + absFilename); } - const std::string realName = cmsys::SystemTools::GetRealPath(absFilename); - const char* contentChars = contentsString.c_str(); + const char* contentChars = contentText.c_str(); if (strstr(contentChars, "ui_") != CM_NULLPTR) { while (this->RegExpUicInclude.find(contentChars)) { const std::string currentUi = this->RegExpUicInclude.match(1); @@ -782,7 +774,7 @@ void cmQtAutoGenerators::ParseContentForUic( cmsys::SystemTools::GetFilenameWithoutLastExtension(currentUi); // basename should be the part of the ui filename used for // finding the correct header, so we need to remove the ui_ part - includedUis[realName].push_back(basename.substr(3)); + uisIncluded[absFilename].push_back(basename.substr(3)); contentChars += this->RegExpUicInclude.end(); } } @@ -791,79 +783,70 @@ void cmQtAutoGenerators::ParseContentForUic( /** * @return True on success */ -bool cmQtAutoGenerators::ParseContentForMoc( - const std::string& absFilename, const std::string& contentsString, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, bool relaxed) +bool cmQtAutoGenerators::MocParseSourceContent( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, bool relaxed) { - // Process if (this->Verbose) { - std::ostringstream err; - err << "AutoMoc: Checking " << absFilename << "\n"; - this->LogInfo(err.str()); + this->LogInfo("AutoMoc: Checking " + absFilename); } const std::string scannedFileAbsPath = - cmsys::SystemTools::GetFilenamePath( - cmsys::SystemTools::GetRealPath(absFilename)) + - '/'; + cmsys::SystemTools::GetFilenamePath(absFilename) + '/'; const std::string scannedFileBasename = cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); std::string macroName; - const bool requiresMoc = this->MocRequired(contentsString, macroName); + const bool requiresMoc = this->MocRequired(contentText, ¯oName); bool ownDotMocIncluded = false; - bool ownMocUnderscoreIncluded = false; - std::string ownMocUnderscoreFile; - std::string ownMocHeaderFile; + std::string ownMocUnderscoreInclude; + std::string ownMocUnderscoreHeader; // first a simple string check for "moc" is *much* faster than the regexp, // and if the string search already fails, we don't have to try the // expensive regexp - const char* contentChars = contentsString.c_str(); + const char* contentChars = contentText.c_str(); if (strstr(contentChars, "moc") != CM_NULLPTR) { // Iterate over all included moc files while (this->RegExpMocInclude.find(contentChars)) { - const std::string currentMoc = this->RegExpMocInclude.match(1); - // Basename of the current moc include - std::string basename = - cmsys::SystemTools::GetFilenameWithoutLastExtension(currentMoc); + const std::string incString = this->RegExpMocInclude.match(1); + // Basename of the moc include + const std::string incBasename = + cmsys::SystemTools::GetFilenameWithoutLastExtension(incString); + std::string incSubDir; + if (incString.find_first_of('/') != std::string::npos) { + incSubDir = cmsys::SystemTools::GetFilenamePath(incString); + incSubDir += '/'; + } // If the moc include is of the moc_foo.cpp style we expect // the Q_OBJECT class declaration in a header file. // If the moc include is of the foo.moc style we need to look for // a Q_OBJECT macro in the current source file, if it contains the // macro we generate the moc file from the source file. - if (cmHasLiteralPrefix(basename, "moc_")) { + if (cmHasLiteralPrefix(incBasename, "moc_")) { // Include: moc_FOO.cxx - // basename should be the part of the moc filename used for - // finding the correct header, so we need to remove the moc_ part - basename = basename.substr(4); - const std::string mocSubDir = - ExtractSubDir(scannedFileAbsPath, currentMoc); - const std::string headerToMoc = FindMatchingHeader( - scannedFileAbsPath, mocSubDir, basename, headerExtensions); - + // Remove the moc_ part + const std::string incRealBasename = incBasename.substr(4); + const std::string headerToMoc = + this->FindMocHeader(scannedFileAbsPath, incRealBasename, incSubDir); if (!headerToMoc.empty()) { - includedMocs[headerToMoc] = currentMoc; - if (relaxed && (basename == scannedFileBasename)) { - ownMocUnderscoreIncluded = true; - ownMocUnderscoreFile = currentMoc; - ownMocHeaderFile = headerToMoc; + // Register moc job + mocsIncluded[headerToMoc] = incString; + this->MocFindDepends(headerToMoc, contentText, mocDepends); + // Store meta information for relaxed mode + if (relaxed && (incRealBasename == scannedFileBasename)) { + ownMocUnderscoreInclude = incString; + ownMocUnderscoreHeader = headerToMoc; } } else { - std::ostringstream err; - err << "AutoMoc: Error: " << absFilename << "\n" - << "The file includes the moc file \"" << currentMoc - << "\", but could not find header \"" << basename << '{' - << JoinExts(headerExtensions) << "}\" "; - if (mocSubDir.empty()) { - err << "in " << scannedFileAbsPath << "\n"; - } else { - err << "neither in " << scannedFileAbsPath << " nor in " - << mocSubDir << "\n"; - } - this->LogError(err.str()); + std::ostringstream ost; + ost << "AutoMoc: Error: " << absFilename << "\n" + << "The file includes the moc file \"" << incString + << "\", but could not find header \"" << incRealBasename << '{' + << JoinExts(this->HeaderExtensions) << "}\"\n"; + this->LogError(ost.str()); return false; } } else { @@ -871,71 +854,80 @@ bool cmQtAutoGenerators::ParseContentForMoc( std::string fileToMoc; if (relaxed) { // Mode: Relaxed - if (!requiresMoc || basename != scannedFileBasename) { - const std::string mocSubDir = - ExtractSubDir(scannedFileAbsPath, currentMoc); - const std::string headerToMoc = FindMatchingHeader( - scannedFileAbsPath, mocSubDir, basename, headerExtensions); + if (requiresMoc && (incBasename == scannedFileBasename)) { + // Include self + fileToMoc = absFilename; + ownDotMocIncluded = true; + } else { + // In relaxed mode try to find a header instead but issue a warning + const std::string headerToMoc = + this->FindMocHeader(scannedFileAbsPath, incBasename, incSubDir); if (!headerToMoc.empty()) { // This is for KDE4 compatibility: fileToMoc = headerToMoc; - if (!requiresMoc && basename == scannedFileBasename) { - std::ostringstream err; - err << "AutoMoc: Warning: " << absFilename << "\n" - << "The file includes the moc file \"" << currentMoc - << "\", but does not contain a " << macroName - << " macro. Running moc on " - << "\"" << headerToMoc << "\" ! Include \"moc_" << basename + if (!requiresMoc && (incBasename == scannedFileBasename)) { + std::ostringstream ost; + ost << "AutoMoc: Warning: " << absFilename << "\n" + << "The file includes the moc file \"" << incString << "\"" + << ", but does not contain a Q_OBJECT or Q_GADGET macro.\n" + << "Running moc on \"" << headerToMoc << "\"!\n" + << "Include \"moc_" << incBasename << ".cpp\" for a compatibility with " "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"; - this->LogWarning(err.str()); + this->LogWarning(ost.str()); } else { - std::ostringstream err; - err << "AutoMoc: Warning: " << absFilename << "\n" - << "The file includes the moc file \"" << currentMoc - << "\" instead of \"moc_" << basename - << ".cpp\". Running moc on " - << "\"" << headerToMoc << "\" ! Include \"moc_" << basename + std::ostringstream ost; + ost << "AutoMoc: Warning: " << absFilename << "\n" + << "The file includes the moc file \"" << incString + << "\" instead of \"moc_" << incBasename << ".cpp\".\n" + << "Running moc on \"" << headerToMoc << "\"!\n" + << "Include \"moc_" << incBasename << ".cpp\" for compatibility with " "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"; - this->LogWarning(err.str()); + this->LogWarning(ost.str()); } } else { - std::ostringstream err; - err << "AutoMoc: Error: " << absFilename << "\n" - << "The file includes the moc file \"" << currentMoc + std::ostringstream ost; + ost << "AutoMoc: Error: " << absFilename << "\n" + << "The file includes the moc file \"" << incString << "\", which seems to be the moc file from a different " "source file. CMake also could not find a matching " "header.\n"; - this->LogError(err.str()); + this->LogError(ost.str()); return false; } - } else { - // Include self - fileToMoc = absFilename; - ownDotMocIncluded = true; } } else { // Mode: Strict - if (basename == scannedFileBasename) { + if (incBasename == scannedFileBasename) { // Include self fileToMoc = absFilename; ownDotMocIncluded = true; + // Accept but issue a warning if moc isn't required + if (!requiresMoc) { + std::ostringstream ost; + ost << "AutoMoc: Error: " << absFilename << "\n" + << "The file includes the moc file \"" << incString << "\"" + << ", but does not contain a Q_OBJECT or Q_GADGET " + "macro.\n"; + this->LogWarning(ost.str()); + } } else { // Don't allow FOO.moc include other than self in strict mode - std::ostringstream err; - err << "AutoMoc: Error: " << absFilename << "\n" - << "The file includes the moc file \"" << currentMoc + std::ostringstream ost; + ost << "AutoMoc: Error: " << absFilename << "\n" + << "The file includes the moc file \"" << incString << "\", which seems to be the moc file from a different " "source file. This is not supported. Include \"" << scannedFileBasename << ".moc\" to run moc on this source file.\n"; - this->LogError(err.str()); + this->LogError(ost.str()); return false; } } if (!fileToMoc.empty()) { - includedMocs[fileToMoc] = currentMoc; + mocsIncluded[fileToMoc] = incString; + this->MocFindDepends(fileToMoc, contentText, mocDepends); } } // Forward content pointer @@ -943,36 +935,38 @@ bool cmQtAutoGenerators::ParseContentForMoc( } } - // In this case, check whether the scanned file itself contains a Q_OBJECT. - // If this is the case, the moc_foo.cpp should probably be generated from - // foo.cpp instead of foo.h, because otherwise it won't build. - // But warn, since this is not how it is supposed to be used. if (requiresMoc && !ownDotMocIncluded) { - if (relaxed && ownMocUnderscoreIncluded) { + // In this case, check whether the scanned file itself contains a Q_OBJECT. + // If this is the case, the moc_foo.cpp should probably be generated from + // foo.cpp instead of foo.h, because otherwise it won't build. + // But warn, since this is not how it is supposed to be used. + if (relaxed && !ownMocUnderscoreInclude.empty()) { // This is for KDE4 compatibility: - std::ostringstream err; - err << "AutoMoc: Warning: " << absFilename << "\n" + std::ostringstream ost; + ost << "AutoMoc: Warning: " << absFilename << "\n" << "The file contains a " << macroName << " macro, but does not include " << "\"" << scannedFileBasename << ".moc\", but instead includes " - << "\"" << ownMocUnderscoreFile << "\". Running moc on " - << "\"" << absFilename << "\" ! Better include \"" - << scannedFileBasename + << "\"" << ownMocUnderscoreInclude << "\".\n" + << "Running moc on \"" << absFilename << "\"!\n" + << "Better include \"" << scannedFileBasename << ".moc\" for compatibility with " "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"; - this->LogWarning(err.str()); + this->LogWarning(ost.str()); // Use scanned source file instead of scanned header file as moc source - includedMocs[absFilename] = ownMocUnderscoreFile; - includedMocs.erase(ownMocHeaderFile); + mocsIncluded[absFilename] = ownMocUnderscoreInclude; + this->MocFindDepends(absFilename, contentText, mocDepends); + // Remove + mocsIncluded.erase(ownMocUnderscoreHeader); } else { // Otherwise always error out since it will not compile: - std::ostringstream err; - err << "AutoMoc: Error: " << absFilename << "\n" + std::ostringstream ost; + ost << "AutoMoc: Error: " << absFilename << "\n" << "The file contains a " << macroName << " macro, but does not include " - << "\"" << scannedFileBasename << ".moc\" !\n"; - this->LogError(err.str()); + << "\"" << scannedFileBasename << ".moc\"!\n"; + this->LogError(ost.str()); return false; } } @@ -980,45 +974,48 @@ bool cmQtAutoGenerators::ParseContentForMoc( return true; } -void cmQtAutoGenerators::SearchHeadersForSourceFile( - const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::set<std::string>& absHeadersMoc, std::set<std::string>& absHeadersUic) +void cmQtAutoGenerators::MocParseHeaderContent( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::string>& mocsNotIncluded, + std::map<std::string, std::set<std::string> >& mocDepends) { - // search for header files and private header files we may need to moc: - std::string basepath = cmsys::SystemTools::GetFilenamePath( - cmsys::SystemTools::GetRealPath(absFilename)); - basepath += '/'; - basepath += cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); - - // Search for regular header - for (std::vector<std::string>::const_iterator ext = headerExtensions.begin(); - ext != headerExtensions.end(); ++ext) { - const std::string headerName = basepath + "." + (*ext); - if (cmsys::SystemTools::FileExists(headerName.c_str())) { - // Moc headers - if (!this->MocSkipTest(absFilename) && !this->MocSkipTest(headerName)) { - absHeadersMoc.insert(headerName); - } - // Uic headers - if (!this->UicSkipTest(absFilename) && !this->UicSkipTest(headerName)) { - absHeadersUic.insert(headerName); - } - break; - } + // Log + if (this->Verbose) { + this->LogInfo("AutoMoc: Checking " + absFilename); + } + if (this->MocRequired(contentText)) { + // Register moc job + mocsNotIncluded[absFilename] = + this->ChecksumedPath(absFilename, "moc_", ".cpp"); + this->MocFindDepends(absFilename, contentText, mocDepends); } - // Search for private header - for (std::vector<std::string>::const_iterator ext = headerExtensions.begin(); - ext != headerExtensions.end(); ++ext) { - const std::string headerName = basepath + "_p." + (*ext); - if (cmsys::SystemTools::FileExists(headerName.c_str())) { +} + +void cmQtAutoGenerators::SearchHeadersForSourceFile( + const std::string& absFilename, std::set<std::string>& mocHeaderFiles, + std::set<std::string>& uicHeaderFiles) const +{ + std::string basepaths[2]; + { + std::string bpath = cmsys::SystemTools::GetFilenamePath(absFilename); + bpath += '/'; + bpath += cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); + // search for default header files and private header files + basepaths[0] = bpath; + basepaths[1] = bpath + "_p"; + } + + for (const std::string* bpit = cmArrayBegin(basepaths); + bpit != cmArrayEnd(basepaths); ++bpit) { + std::string headerName; + if (this->FindHeader(headerName, *bpit)) { // Moc headers - if (!this->MocSkipTest(absFilename) && !this->MocSkipTest(headerName)) { - absHeadersMoc.insert(headerName); + if (!this->MocSkip(absFilename) && !this->MocSkip(headerName)) { + mocHeaderFiles.insert(headerName); } // Uic headers - if (!this->UicSkipTest(absFilename) && !this->UicSkipTest(headerName)) { - absHeadersUic.insert(headerName); + if (!this->UicSkip(absFilename) && !this->UicSkip(headerName)) { + uicHeaderFiles.insert(headerName); } break; } @@ -1026,98 +1023,88 @@ void cmQtAutoGenerators::SearchHeadersForSourceFile( } void cmQtAutoGenerators::ParseHeaders( - const std::set<std::string>& absHeadersMoc, - const std::set<std::string>& absHeadersUic, - const std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& notIncludedMocs, - std::map<std::string, std::vector<std::string> >& includedUis) + const std::set<std::string>& mocHeaderFiles, + const std::set<std::string>& uicHeaderFiles, + const std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::string>& mocsNotIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, + std::map<std::string, std::vector<std::string> >& uisIncluded) { // Merged header files list to read files only once std::set<std::string> headerFiles; - headerFiles.insert(absHeadersMoc.begin(), absHeadersMoc.end()); - headerFiles.insert(absHeadersUic.begin(), absHeadersUic.end()); + headerFiles.insert(mocHeaderFiles.begin(), mocHeaderFiles.end()); + headerFiles.insert(uicHeaderFiles.begin(), uicHeaderFiles.end()); for (std::set<std::string>::const_iterator hIt = headerFiles.begin(); hIt != headerFiles.end(); ++hIt) { const std::string& headerName = *hIt; - const std::string contents = ReadAll(headerName); + const std::string contentText = ReadAll(headerName); // Parse header content for MOC - if ((absHeadersMoc.find(headerName) != absHeadersMoc.end()) && - (includedMocs.find(headerName) == includedMocs.end())) { - // Process - if (this->Verbose) { - std::ostringstream err; - err << "AutoMoc: Checking " << headerName << "\n"; - this->LogInfo(err.str()); - } - std::string macroName; - if (this->MocRequired(contents, macroName)) { - notIncludedMocs[headerName] = fpathCheckSum.getPart(headerName) + - "/moc_" + - cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName) + - ".cpp"; - } + if ((mocHeaderFiles.find(headerName) != mocHeaderFiles.end()) && + (mocsIncluded.find(headerName) == mocsIncluded.end())) { + this->MocParseHeaderContent(headerName, contentText, mocsNotIncluded, + mocDepends); } // Parse header content for UIC - if (absHeadersUic.find(headerName) != absHeadersUic.end()) { - this->ParseContentForUic(headerName, contents, includedUis); + if (uicHeaderFiles.find(headerName) != uicHeaderFiles.end()) { + this->UicParseContent(headerName, contentText, uisIncluded); } } } bool cmQtAutoGenerators::MocGenerateAll( - const std::map<std::string, std::string>& includedMocs, - const std::map<std::string, std::string>& notIncludedMocs) + const std::map<std::string, std::string>& mocsIncluded, + const std::map<std::string, std::string>& mocsNotIncluded, + const std::map<std::string, std::set<std::string> >& mocDepends) { - if (this->MocExecutable.empty()) { + if (!this->MocEnabled()) { return true; } + bool mocCompFileGenerated = false; + bool mocCompChanged = false; + // look for name collisions { std::multimap<std::string, std::string> collisions; // Test merged map of included and notIncluded - std::map<std::string, std::string> mergedMocs(includedMocs); - mergedMocs.insert(notIncludedMocs.begin(), notIncludedMocs.end()); + std::map<std::string, std::string> mergedMocs(mocsIncluded); + mergedMocs.insert(mocsNotIncluded.begin(), mocsNotIncluded.end()); if (this->NameCollisionTest(mergedMocs, collisions)) { - std::ostringstream err; - err << "AutoMoc: Error: " + std::ostringstream ost; + ost << "AutoMoc: Error: " "The same moc file will be generated " - "from different sources." - << std::endl - << "To avoid this error either" << std::endl - << "- rename the source files or" << std::endl - << "- do not include the (moc_NAME.cpp|NAME.moc) file" << std::endl; - this->LogErrorNameCollision(err.str(), collisions); + "from different sources.\n" + "To avoid this error either\n" + "- rename the source files or\n" + "- do not include the (moc_NAME.cpp|NAME.moc) file"; + this->LogErrorNameCollision(ost.str(), collisions); return false; } } - - // generate moc files that are included by source files. + // Generate moc files that are included by source files. { - const std::string subDirPrefix = "include/"; + const std::string subDir = "include/"; for (std::map<std::string, std::string>::const_iterator it = - includedMocs.begin(); - it != includedMocs.end(); ++it) { - if (!this->MocGenerateFile(it->first, it->second, subDirPrefix)) { + mocsIncluded.begin(); + it != mocsIncluded.end(); ++it) { + if (!this->MocGenerateFile(it->first, it->second, subDir, mocDepends)) { if (this->RunMocFailed) { return false; } } } } - - // generate moc files that are _not_ included by source files. - bool automocCppChanged = false; + // Generate moc files that are _not_ included by source files. { - const std::string subDirPrefix; + const std::string subDir; for (std::map<std::string, std::string>::const_iterator it = - notIncludedMocs.begin(); - it != notIncludedMocs.end(); ++it) { - if (this->MocGenerateFile(it->first, it->second, subDirPrefix)) { - automocCppChanged = true; + mocsNotIncluded.begin(); + it != mocsNotIncluded.end(); ++it) { + if (this->MocGenerateFile(it->first, it->second, subDir, mocDepends)) { + mocCompFileGenerated = true; } else { if (this->RunMocFailed) { return false; @@ -1129,138 +1116,158 @@ bool cmQtAutoGenerators::MocGenerateAll( // Compose moc_compilation.cpp content std::string automocSource; { - std::ostringstream outStream; - outStream << "/* This file is autogenerated, do not edit*/\n"; - if (notIncludedMocs.empty()) { + std::ostringstream ost; + ost << "/* This file is autogenerated, do not edit*/\n"; + if (mocsNotIncluded.empty()) { // Dummy content - outStream << "enum some_compilers { need_more_than_nothing };\n"; + ost << "enum some_compilers { need_more_than_nothing };\n"; } else { // Valid content for (std::map<std::string, std::string>::const_iterator it = - notIncludedMocs.begin(); - it != notIncludedMocs.end(); ++it) { - outStream << "#include \"" << it->second << "\"\n"; + mocsNotIncluded.begin(); + it != mocsNotIncluded.end(); ++it) { + ost << "#include \"" << it->second << "\"\n"; } } - outStream.flush(); - automocSource = outStream.str(); + automocSource = ost.str(); } - // Check if we even need to update moc_compilation.cpp - if (!automocCppChanged) { - // compare contents of the moc_compilation.cpp file - const std::string oldContents = ReadAll(this->OutMocCppFilenameAbs); - if (oldContents == automocSource) { - // nothing changed: don't touch the moc_compilation.cpp file - if (this->Verbose) { - std::ostringstream err; - err << "AutoMoc: " << this->OutMocCppFilenameRel << " still up to date" - << std::endl; - this->LogInfo(err.str()); - } - return true; - } - } - - // Actually write moc_compilation.cpp + // Check if the content of moc_compilation.cpp changed { - std::string msg = "Generating MOC compilation "; - msg += this->OutMocCppFilenameRel; - this->LogBold(msg); + const std::string oldContents = ReadAll(this->MocCppFilenameAbs); + mocCompChanged = (oldContents != automocSource); } - // Make sure the parent directory exists - bool success = this->MakeParentDirectory(this->OutMocCppFilenameAbs); - if (success) { - cmsys::ofstream outfile; - outfile.open(this->OutMocCppFilenameAbs.c_str(), std::ios::trunc); - if (!outfile) { - success = false; - std::ostringstream err; - err << "AutoMoc: error opening " << this->OutMocCppFilenameAbs << "\n"; - this->LogError(err.str()); - } else { - outfile << automocSource; - // Check for write errors - if (!outfile.good()) { + + bool success = true; + if (mocCompChanged) { + // Actually write moc_compilation.cpp + this->LogBold("Generating MOC compilation " + this->MocCppFilenameRel); + + // Make sure the parent directory exists + success = this->MakeParentDirectory(this->MocCppFilenameAbs); + if (success) { + cmsys::ofstream outfile; + outfile.open(this->MocCppFilenameAbs.c_str(), std::ios::trunc); + if (!outfile) { success = false; - std::ostringstream err; - err << "AutoMoc: error writing " << this->OutMocCppFilenameAbs << "\n"; - this->LogError(err.str()); + this->LogError("AutoMoc: error opening " + this->MocCppFilenameAbs); + } else { + outfile << automocSource; + // Check for write errors + if (!outfile.good()) { + success = false; + this->LogError("AutoMoc: error writing " + this->MocCppFilenameAbs); + } } } + } else if (mocCompFileGenerated) { + // Only touch moc_compilation.cpp + if (this->Verbose) { + this->LogInfo("Touching MOC compilation " + this->MocCppFilenameRel); + } + cmSystemTools::Touch(this->MocCppFilenameAbs, false); } + return success; } /** * @return True if a moc file was created. False may indicate an error. */ -bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile, - const std::string& mocFileName, - const std::string& subDirPrefix) +bool cmQtAutoGenerators::MocGenerateFile( + const std::string& sourceFile, const std::string& mocFileName, + const std::string& subDirPrefix, + const std::map<std::string, std::set<std::string> >& mocDepends) { + bool mocGenerated = false; + bool generateMoc = this->GenerateAllMoc; + const std::string mocFileRel = this->AutogenBuildSubDir + subDirPrefix + mocFileName; const std::string mocFileAbs = this->CurrentBinaryDir + mocFileRel; - bool generateMoc = this->GenerateMocAll; - // Test if the source file is newer that the build file if (!generateMoc) { + // Test if the source file is newer that the build file generateMoc = FileAbsentOrOlder(mocFileAbs, sourceFile); + if (!generateMoc) { + // Test if a dependency file changed + std::map<std::string, std::set<std::string> >::const_iterator dit = + mocDepends.find(sourceFile); + if (dit != mocDepends.end()) { + for (std::set<std::string>::const_iterator fit = dit->second.begin(); + fit != dit->second.end(); ++fit) { + if (FileAbsentOrOlder(mocFileAbs, *fit)) { + generateMoc = true; + break; + } + } + } + } } if (generateMoc) { // Log this->LogBold("Generating MOC source " + mocFileRel); // Make sure the parent directory exists - if (!this->MakeParentDirectory(mocFileAbs)) { - this->RunMocFailed = true; - return false; - } - - std::vector<std::string> command; - command.push_back(this->MocExecutable); - command.insert(command.end(), this->MocIncludes.begin(), - this->MocIncludes.end()); - command.insert(command.end(), this->MocDefinitions.begin(), - this->MocDefinitions.end()); - command.insert(command.end(), this->MocOptions.begin(), - this->MocOptions.end()); + if (this->MakeParentDirectory(mocFileAbs)) { + // Compose moc command + std::vector<std::string> cmd; + cmd.push_back(this->MocExecutable); + cmd.insert(cmd.end(), this->MocIncludes.begin(), + this->MocIncludes.end()); + // Add definitions + for (std::vector<std::string>::const_iterator it = + this->MocDefinitions.begin(); + it != this->MocDefinitions.end(); ++it) { + cmd.push_back("-D" + (*it)); + } + cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end()); #ifdef _WIN32 - command.push_back("-DWIN32"); + cmd.push_back("-DWIN32"); #endif - command.push_back("-o"); - command.push_back(mocFileAbs); - command.push_back(sourceFile); + cmd.push_back("-o"); + cmd.push_back(mocFileAbs); + cmd.push_back(sourceFile); - if (this->Verbose) { - this->LogCommand(command); - } + // Log moc command + if (this->Verbose) { + this->LogCommand(cmd); + } - std::string output; - int retVal = 0; - bool result = - cmSystemTools::RunSingleCommand(command, &output, &output, &retVal); - if (!result || retVal) { - { - std::ostringstream err; - err << "AutoMoc: Error: moc process for " << mocFileRel << " failed:\n" - << output << std::endl; - this->LogError(err.str()); + // Execute moc command + bool res = false; + int retVal = 0; + std::string output; + res = cmSystemTools::RunSingleCommand(cmd, &output, &output, &retVal); + + if (!res || (retVal != 0)) { + // Command failed + { + std::ostringstream ost; + ost << "AutoMoc: Error: moc process failed for\n"; + ost << "\"" << mocFileRel << "\"\n"; + ost << "AutoMoc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoMoc: Command output:\n" << output << "\n"; + this->LogError(ost.str()); + } + cmSystemTools::RemoveFile(mocFileAbs); + this->RunMocFailed = true; + } else { + // Success + mocGenerated = true; } - cmSystemTools::RemoveFile(mocFileAbs); + } else { + // Parent directory creation failed this->RunMocFailed = true; - return false; } - return true; } - return false; + return mocGenerated; } bool cmQtAutoGenerators::UicGenerateAll( - const std::map<std::string, std::vector<std::string> >& includedUis) + const std::map<std::string, std::vector<std::string> >& uisIncluded) { - if (this->UicExecutable.empty()) { + if (!this->UicEnabled()) { return true; } @@ -1268,8 +1275,8 @@ bool cmQtAutoGenerators::UicGenerateAll( std::map<std::string, std::map<std::string, std::string> > uiGenMap; std::map<std::string, std::string> testMap; for (std::map<std::string, std::vector<std::string> >::const_iterator it = - includedUis.begin(); - it != includedUis.end(); ++it) { + uisIncluded.begin(); + it != uisIncluded.end(); ++it) { // source file path std::string sourcePath = cmsys::SystemTools::GetFilenamePath(it->first); sourcePath += '/'; @@ -1290,12 +1297,11 @@ bool cmQtAutoGenerators::UicGenerateAll( { std::multimap<std::string, std::string> collisions; if (this->NameCollisionTest(testMap, collisions)) { - std::ostringstream err; - err << "AutoUic: Error: The same ui_NAME.h file will be generated " - "from different sources." - << std::endl - << "To avoid this error rename the source files." << std::endl; - this->LogErrorNameCollision(err.str(), collisions); + std::ostringstream ost; + ost << "AutoUic: Error: The same ui_NAME.h file will be generated " + "from different sources.\n" + "To avoid this error rename the source files.\n"; + this->LogErrorNameCollision(ost.str(), collisions); return false; } } @@ -1327,13 +1333,15 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, const std::string& uiInputFile, const std::string& uiOutputFile) { + bool uicGenerated = false; + bool generateUic = this->GenerateAllUic; + const std::string uicFileRel = this->AutogenBuildSubDir + "include/" + uiOutputFile; const std::string uicFileAbs = this->CurrentBinaryDir + uicFileRel; - bool generateUic = this->GenerateUicAll; - // Test if the source file is newer that the build file if (!generateUic) { + // Test if the source file is newer that the build file generateUic = FileAbsentOrOlder(uicFileAbs, uiInputFile); } if (generateUic) { @@ -1341,55 +1349,64 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, this->LogBold("Generating UIC header " + uicFileRel); // Make sure the parent directory exists - if (!this->MakeParentDirectory(uicFileAbs)) { - this->RunUicFailed = true; - return false; - } - - std::vector<std::string> command; - command.push_back(this->UicExecutable); - - std::vector<std::string> opts = this->UicTargetOptions; - std::map<std::string, std::string>::const_iterator optionIt = - this->UicOptions.find(uiInputFile); - if (optionIt != this->UicOptions.end()) { - std::vector<std::string> fileOpts; - cmSystemTools::ExpandListArgument(optionIt->second, fileOpts); - UicMergeOptions(opts, fileOpts, this->QtMajorVersion == "5"); - } - command.insert(command.end(), opts.begin(), opts.end()); + if (this->MakeParentDirectory(uicFileAbs)) { + // Compose uic command + std::vector<std::string> cmd; + cmd.push_back(this->UicExecutable); + { + std::vector<std::string> opts = this->UicTargetOptions; + std::map<std::string, std::string>::const_iterator optionIt = + this->UicOptions.find(uiInputFile); + if (optionIt != this->UicOptions.end()) { + std::vector<std::string> fileOpts; + cmSystemTools::ExpandListArgument(optionIt->second, fileOpts); + UicMergeOptions(opts, fileOpts, (this->QtMajorVersion == "5")); + } + cmd.insert(cmd.end(), opts.begin(), opts.end()); + } + cmd.push_back("-o"); + cmd.push_back(uicFileAbs); + cmd.push_back(uiInputFile); - command.push_back("-o"); - command.push_back(uicFileAbs); - command.push_back(uiInputFile); + // Log command + if (this->Verbose) { + this->LogCommand(cmd); + } - if (this->Verbose) { - this->LogCommand(command); - } - std::string output; - int retVal = 0; - bool result = - cmSystemTools::RunSingleCommand(command, &output, &output, &retVal); - if (!result || retVal) { - { - std::ostringstream err; - err << "AutoUic: Error: uic process for " << uicFileRel - << " needed by\n \"" << realName << "\"\nfailed:\n" - << output << std::endl; - this->LogError(err.str()); + // Execute command + bool res = false; + int retVal = 0; + std::string output; + res = cmSystemTools::RunSingleCommand(cmd, &output, &output, &retVal); + + if (!res || (retVal != 0)) { + // Command failed + { + std::ostringstream ost; + ost << "AutoUic: Error: uic process failed for\n"; + ost << "\"" << uicFileRel << "\" needed by\n"; + ost << "\"" << realName << "\"\n"; + ost << "AutoUic: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoUic: Command output:\n" << output << "\n"; + this->LogError(ost.str()); + } + cmSystemTools::RemoveFile(uicFileAbs); + this->RunUicFailed = true; + } else { + // Success + uicGenerated = true; } - cmSystemTools::RemoveFile(uicFileAbs); + } else { + // Parent directory creation failed this->RunUicFailed = true; - return false; } - return true; } - return false; + return uicGenerated; } -bool cmQtAutoGenerators::QrcGenerateAll() +bool cmQtAutoGenerators::RccGenerateAll() { - if (this->RccExecutable.empty()) { + if (!this->RccEnabled()) { return true; } @@ -1399,9 +1416,8 @@ bool cmQtAutoGenerators::QrcGenerateAll() si != this->RccSources.end(); ++si) { const std::string ext = cmsys::SystemTools::GetFilenameLastExtension(*si); if (ext == ".qrc") { - qrcGenMap[*si] = this->AutogenBuildSubDir + fpathCheckSum.getPart(*si) + - "/qrc_" + cmsys::SystemTools::GetFilenameWithoutLastExtension(*si) + - ".cpp"; + qrcGenMap[*si] = + this->AutogenBuildSubDir + this->ChecksumedPath(*si, "qrc_", ".cpp"); } } @@ -1409,12 +1425,11 @@ bool cmQtAutoGenerators::QrcGenerateAll() { std::multimap<std::string, std::string> collisions; if (this->NameCollisionTest(qrcGenMap, collisions)) { - std::ostringstream err; - err << "AutoRcc: Error: The same qrc_NAME.cpp file" - " will be generated from different sources." - << std::endl - << "To avoid this error rename the source .qrc files." << std::endl; - this->LogErrorNameCollision(err.str(), collisions); + std::ostringstream ost; + ost << "AutoRcc: Error: The same qrc_NAME.cpp file" + " will be generated from different sources.\n" + "To avoid this error rename the source .qrc files.\n"; + this->LogErrorNameCollision(ost.str(), collisions); return false; } } @@ -1424,7 +1439,7 @@ bool cmQtAutoGenerators::QrcGenerateAll() qrcGenMap.begin(); si != qrcGenMap.end(); ++si) { bool unique = FileNameIsUnique(si->first, qrcGenMap); - if (!this->QrcGenerateFile(si->first, si->second, unique)) { + if (!this->RccGenerateFile(si->first, si->second, unique)) { if (this->RunRccFailed) { return false; } @@ -1436,146 +1451,166 @@ bool cmQtAutoGenerators::QrcGenerateAll() /** * @return True if a rcc file was created. False may indicate an error. */ -bool cmQtAutoGenerators::QrcGenerateFile(const std::string& qrcInputFile, - const std::string& qrcOutputFile, +bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, + const std::string& rccOutputFile, bool unique_n) { - std::string symbolName = - cmsys::SystemTools::GetFilenameWithoutLastExtension(qrcInputFile); - if (!unique_n) { - symbolName += "_"; - symbolName += fpathCheckSum.getPart(qrcInputFile); - } - // Replace '-' with '_'. The former is valid for - // file names but not for symbol names. - std::replace(symbolName.begin(), symbolName.end(), '-', '_'); - - const std::string qrcBuildFile = this->CurrentBinaryDir + qrcOutputFile; - - bool generateQrc = this->GenerateRccAll; - // Test if the resources list file is newer than build file - if (!generateQrc) { - generateQrc = FileAbsentOrOlder(qrcBuildFile, qrcInputFile); - } - // Test if any resource file is newer than the build file - if (!generateQrc) { - const std::vector<std::string>& files = this->RccInputs[qrcInputFile]; - for (std::vector<std::string>::const_iterator it = files.begin(); - it != files.end(); ++it) { - if (FileAbsentOrOlder(qrcBuildFile, *it)) { - generateQrc = true; - break; + bool rccGenerated = false; + bool generateRcc = this->GenerateAllRcc; + + const std::string rccBuildFile = this->CurrentBinaryDir + rccOutputFile; + + if (!generateRcc) { + // Test if the resources list file is newer than build file + generateRcc = FileAbsentOrOlder(rccBuildFile, rccInputFile); + if (!generateRcc) { + // Test if any resource file is newer than the build file + const std::vector<std::string>& files = this->RccInputs[rccInputFile]; + for (std::vector<std::string>::const_iterator it = files.begin(); + it != files.end(); ++it) { + if (FileAbsentOrOlder(rccBuildFile, *it)) { + generateRcc = true; + break; + } } } } - if (generateQrc) { - { - std::string msg = "Generating RCC source "; - msg += qrcOutputFile; - this->LogBold(msg); - } + if (generateRcc) { + // Log + this->LogBold("Generating RCC source " + rccOutputFile); // Make sure the parent directory exists - if (!this->MakeParentDirectory(qrcOutputFile)) { - this->RunRccFailed = true; - return false; - } - - std::vector<std::string> command; - command.push_back(this->RccExecutable); - { - std::map<std::string, std::string>::const_iterator optionIt = - this->RccOptions.find(qrcInputFile); - if (optionIt != this->RccOptions.end()) { - cmSystemTools::ExpandListArgument(optionIt->second, command); + if (this->MakeParentDirectory(rccBuildFile)) { + // Compose symbol name + std::string symbolName = + cmsys::SystemTools::GetFilenameWithoutLastExtension(rccInputFile); + if (!unique_n) { + symbolName += "_"; + symbolName += fpathCheckSum.getPart(rccInputFile); } - } - command.push_back("-name"); - command.push_back(symbolName); - command.push_back("-o"); - command.push_back(qrcBuildFile); - command.push_back(qrcInputFile); + // Replace '-' with '_'. The former is valid for + // file names but not for symbol names. + std::replace(symbolName.begin(), symbolName.end(), '-', '_'); - if (this->Verbose) { - this->LogCommand(command); - } - std::string output; - int retVal = 0; - bool result = - cmSystemTools::RunSingleCommand(command, &output, &output, &retVal); - if (!result || retVal) { + // Compose rcc command + std::vector<std::string> cmd; + cmd.push_back(this->RccExecutable); { - std::ostringstream err; - err << "AutoRcc: Error: rcc process for " << qrcOutputFile - << " failed:\n" - << output << std::endl; - this->LogError(err.str()); + std::map<std::string, std::string>::const_iterator optionIt = + this->RccOptions.find(rccInputFile); + if (optionIt != this->RccOptions.end()) { + cmSystemTools::ExpandListArgument(optionIt->second, cmd); + } + } + cmd.push_back("-name"); + cmd.push_back(symbolName); + cmd.push_back("-o"); + cmd.push_back(rccBuildFile); + cmd.push_back(rccInputFile); + + // Log command + if (this->Verbose) { + this->LogCommand(cmd); } - cmSystemTools::RemoveFile(qrcBuildFile); + + // Execute command + bool res = false; + int retVal = 0; + std::string output; + res = cmSystemTools::RunSingleCommand(cmd, &output, &output, &retVal); + if (!res || (retVal != 0)) { + // Command failed + { + std::ostringstream ost; + ost << "AutoRcc: Error: rcc process failed for\n"; + ost << "\"" << rccOutputFile << "\"\n"; + ost << "AutoRcc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoRcc: Command output:\n" << output << "\n"; + this->LogError(ost.str()); + } + cmSystemTools::RemoveFile(rccBuildFile); + this->RunRccFailed = true; + } else { + // Success + rccGenerated = true; + } + } else { + // Parent directory creation failed this->RunRccFailed = true; - return false; } - return true; } - return false; + return rccGenerated; } void cmQtAutoGenerators::LogErrorNameCollision( const std::string& message, - const std::multimap<std::string, std::string>& collisions) + const std::multimap<std::string, std::string>& collisions) const { typedef std::multimap<std::string, std::string>::const_iterator Iter; - std::ostringstream err; + std::ostringstream ost; // Add message - err << message; + if (!message.empty()) { + ost << message; + if (message[message.size() - 1] != '\n') { + ost << '\n'; + } + } // Append collision list for (Iter it = collisions.begin(); it != collisions.end(); ++it) { - err << it->first << " : " << it->second << std::endl; + ost << it->first << " : " << it->second << '\n'; } - this->LogError(err.str()); + this->LogError(ost.str()); } -void cmQtAutoGenerators::LogBold(const std::string& message) +void cmQtAutoGenerators::LogBold(const std::string& message) const { cmSystemTools::MakefileColorEcho(cmsysTerminal_Color_ForegroundBlue | cmsysTerminal_Color_ForegroundBold, message.c_str(), true, this->ColorOutput); } -void cmQtAutoGenerators::LogInfo(const std::string& message) +void cmQtAutoGenerators::LogInfo(const std::string& message) const { - std::cout << message.c_str(); + std::string msg(message); + if (!msg.empty()) { + if (msg[msg.size() - 1] != '\n') { + msg.push_back('\n'); + } + cmSystemTools::Stdout(msg.c_str(), msg.size()); + } } -void cmQtAutoGenerators::LogWarning(const std::string& message) +void cmQtAutoGenerators::LogWarning(const std::string& message) const { - std::ostringstream ostr; - ostr << message << "\n"; - std::cout << message.c_str(); + std::string msg(message); + if (!msg.empty()) { + if (msg[msg.size() - 1] != '\n') { + msg.push_back('\n'); + } + // Append empty line + msg.push_back('\n'); + cmSystemTools::Stdout(msg.c_str(), msg.size()); + } } -void cmQtAutoGenerators::LogError(const std::string& message) +void cmQtAutoGenerators::LogError(const std::string& message) const { - std::ostringstream ostr; - ostr << message << "\n\n"; - std::cerr << ostr.str(); + std::string msg(message); + if (!msg.empty()) { + if (msg[msg.size() - 1] != '\n') { + msg.push_back('\n'); + } + // Append empty line + msg.push_back('\n'); + cmSystemTools::Stderr(msg.c_str(), msg.size()); + } } -void cmQtAutoGenerators::LogCommand(const std::vector<std::string>& command) +void cmQtAutoGenerators::LogCommand( + const std::vector<std::string>& command) const { - std::ostringstream sbuf; - for (std::vector<std::string>::const_iterator cmdIt = command.begin(); - cmdIt != command.end(); ++cmdIt) { - if (cmdIt != command.begin()) { - sbuf << " "; - } - sbuf << *cmdIt; - } - if (!sbuf.str().empty()) { - sbuf << std::endl; - this->LogInfo(sbuf.str()); - } + this->LogInfo(cmJoin(command, " ")); } /** @@ -1584,7 +1619,7 @@ void cmQtAutoGenerators::LogCommand(const std::vector<std::string>& command) */ bool cmQtAutoGenerators::NameCollisionTest( const std::map<std::string, std::string>& genFiles, - std::multimap<std::string, std::string>& collisions) + std::multimap<std::string, std::string>& collisions) const { typedef std::map<std::string, std::string>::const_iterator Iter; typedef std::map<std::string, std::string>::value_type VType; @@ -1609,19 +1644,131 @@ bool cmQtAutoGenerators::NameCollisionTest( } /** + * @brief Generates a file path based on the checksum of the source file path + * @return The path + */ +std::string cmQtAutoGenerators::ChecksumedPath(const std::string& sourceFile, + const char* basePrefix, + const char* baseSuffix) const +{ + std::string res = fpathCheckSum.getPart(sourceFile); + res += "/"; + res += basePrefix; + res += cmsys::SystemTools::GetFilenameWithoutLastExtension(sourceFile); + res += baseSuffix; + return res; +} + +/** + * @brief Tries to find the header file to the given file base path by + * appending different header extensions + * @return True on success + */ +bool cmQtAutoGenerators::FindHeader(std::string& header, + const std::string& testBasePath) const +{ + for (std::vector<std::string>::const_iterator ext = + this->HeaderExtensions.begin(); + ext != this->HeaderExtensions.end(); ++ext) { + std::string testFilePath(testBasePath); + testFilePath += '.'; + testFilePath += (*ext); + if (cmsys::SystemTools::FileExists(testFilePath.c_str())) { + header = testFilePath; + return true; + } + } + return false; +} + +bool cmQtAutoGenerators::FindHeaderGlobal( + std::string& header, const std::string& testBasePath) const +{ + for (std::vector<std::string>::const_iterator iit = + this->MocIncludePaths.begin(); + iit != this->MocIncludePaths.end(); ++iit) { + const std::string fullPath = ((*iit) + '/' + testBasePath); + if (FindHeader(header, fullPath)) { + return true; + } + } + return false; +} + +std::string cmQtAutoGenerators::FindMocHeader(const std::string& basePath, + const std::string& baseName, + const std::string& subDir) const +{ + std::string header; + do { + if (!subDir.empty()) { + if (this->FindHeader(header, basePath + subDir + baseName)) { + break; + } + } + if (this->FindHeader(header, basePath + baseName)) { + break; + } + // Try include directories + if (this->FindHeaderGlobal(header, subDir + baseName)) { + break; + } + } while (false); + // Sanitize + if (!header.empty()) { + header = cmsys::SystemTools::GetRealPath(header); + } + return header; +} + +std::string cmQtAutoGenerators::FindIncludedFile( + const std::string& sourceFile, const std::string& includeString) const +{ + // Search in vicinity of the source + { + std::string testPath = cmSystemTools::GetFilenamePath(sourceFile); + testPath += '/'; + testPath += includeString; + if (cmsys::SystemTools::FileExists(testPath.c_str())) { + return cmsys::SystemTools::GetRealPath(testPath); + } + } + // Search globally + return FindInIncludeDirectories(includeString); +} + +/** + * @brief Tries to find a file in the include directories + * @return True on success + */ +std::string cmQtAutoGenerators::FindInIncludeDirectories( + const std::string& includeString) const +{ + std::string res; + for (std::vector<std::string>::const_iterator iit = + this->MocIncludePaths.begin(); + iit != this->MocIncludePaths.end(); ++iit) { + const std::string fullPath = ((*iit) + '/' + includeString); + if (cmsys::SystemTools::FileExists(fullPath.c_str())) { + res = cmsys::SystemTools::GetRealPath(fullPath); + break; + } + } + return res; +} + +/** * @brief Generates the parent directory of the given file on demand * @return True on success */ -bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) +bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) const { bool success = true; const std::string dirName = cmSystemTools::GetFilenamePath(filename); if (!dirName.empty()) { success = cmsys::SystemTools::MakeDirectory(dirName); if (!success) { - std::ostringstream err; - err << "AutoGen: Directory creation failed: " << dirName << std::endl; - this->LogError(err.str()); + this->LogError("AutoGen: Directory creation failed: " + dirName); } } return success; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 7891eb9..c20b83c 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -7,10 +7,10 @@ #include <cmFilePathChecksum.h> #include <cmsys/RegularExpression.hxx> -#include <list> #include <map> #include <set> #include <string> +#include <utility> #include <vector> class cmMakefile; @@ -22,64 +22,92 @@ public: bool Run(const std::string& targetDirectory, const std::string& config); private: + // - Types + + /// @brief Used to extract additional dependencies from content text + struct MocDependFilter + { + std::string key; + cmsys::RegularExpression regExp; + }; + typedef std::pair<std::string, cmsys::RegularExpression> MacroFilter; + // - Configuration bool ReadAutogenInfoFile(cmMakefile* makefile, const std::string& targetDirectory, const std::string& config); - std::string MocSettingsStringCompose(); - std::string UicSettingsStringCompose(); - std::string RccSettingsStringCompose(); - void OldSettingsReadFile(cmMakefile* makefile, - const std::string& targetDirectory); - bool OldSettingsWriteFile(const std::string& targetDirectory); + bool MocEnabled() const { return !this->MocExecutable.empty(); } + bool UicEnabled() const { return !this->UicExecutable.empty(); } + bool RccEnabled() const { return !this->RccExecutable.empty(); } + + // - Settings file + void SettingsFileRead(cmMakefile* makefile, + const std::string& targetDirectory); + bool SettingsFileWrite(const std::string& targetDirectory); + + bool GenerateAllAny() const + { + return (this->GenerateAllMoc || this->GenerateAllRcc || + this->GenerateAllUic); + } // - Init and run - void Init(); - bool RunAutogen(cmMakefile* makefile); + void Init(cmMakefile* makefile); + bool RunAutogen(); // - Content analysis - bool MocRequired(const std::string& text, std::string& macroName); - bool MocSkipTest(const std::string& absFilename); - bool UicSkipTest(const std::string& absFilename); + bool MocRequired(const std::string& contentText, + std::string* macroName = CM_NULLPTR); + void MocFindDepends( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::set<std::string> >& mocDepends); + + bool MocSkip(const std::string& absFilename) const; + bool UicSkip(const std::string& absFilename) const; bool ParseSourceFile( const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, + std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, std::map<std::string, std::vector<std::string> >& includedUis, bool relaxed); - void SearchHeadersForSourceFile( - const std::string& absFilename, - const std::vector<std::string>& headerExtensions, - std::set<std::string>& absHeadersMoc, - std::set<std::string>& absHeadersUic); + void SearchHeadersForSourceFile(const std::string& absFilename, + std::set<std::string>& mocHeaderFiles, + std::set<std::string>& uicHeaderFiles) const; void ParseHeaders( - const std::set<std::string>& absHeadersMoc, - const std::set<std::string>& absHeadersUic, - const std::map<std::string, std::string>& includedMocs, - std::map<std::string, std::string>& notIncludedMocs, + const std::set<std::string>& mocHeaderFiles, + const std::set<std::string>& uicHeaderFiles, + const std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::string>& mocsNotIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, std::map<std::string, std::vector<std::string> >& includedUis); - void ParseContentForUic( - const std::string& fileName, const std::string& contentsString, + void UicParseContent( + const std::string& fileName, const std::string& contentText, std::map<std::string, std::vector<std::string> >& includedUis); - bool ParseContentForMoc(const std::string& absFilename, - const std::string& contentsString, - const std::vector<std::string>& headerExtensions, - std::map<std::string, std::string>& includedMocs, - bool relaxed); + bool MocParseSourceContent( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::string>& mocsIncluded, + std::map<std::string, std::set<std::string> >& mocDepends, bool relaxed); + + void MocParseHeaderContent( + const std::string& absFilename, const std::string& contentText, + std::map<std::string, std::string>& mocsNotIncluded, + std::map<std::string, std::set<std::string> >& mocDepends); // - Moc file generation bool MocGenerateAll( - const std::map<std::string, std::string>& includedMocs, - const std::map<std::string, std::string>& notIncludedMocs); - bool MocGenerateFile(const std::string& sourceFile, - const std::string& mocFileName, - const std::string& subDirPrefix); + const std::map<std::string, std::string>& mocsIncluded, + const std::map<std::string, std::string>& mocsNotIncluded, + const std::map<std::string, std::set<std::string> >& mocDepends); + bool MocGenerateFile( + const std::string& sourceFile, const std::string& mocFileName, + const std::string& subDirPrefix, + const std::map<std::string, std::set<std::string> >& mocDepends); // - Uic file generation bool UicGenerateAll( @@ -88,25 +116,39 @@ private: const std::string& uiInputFile, const std::string& uiOutputFile); - // - Qrc file generation - bool QrcGenerateAll(); - bool QrcGenerateFile(const std::string& qrcInputFile, + // - Rcc file generation + bool RccGenerateAll(); + bool RccGenerateFile(const std::string& qrcInputFile, const std::string& qrcOutputFile, bool unique_n); // - Logging void LogErrorNameCollision( const std::string& message, - const std::multimap<std::string, std::string>& collisions); - void LogBold(const std::string& message); - void LogInfo(const std::string& message); - void LogWarning(const std::string& message); - void LogError(const std::string& message); - void LogCommand(const std::vector<std::string>& command); + const std::multimap<std::string, std::string>& collisions) const; + void LogBold(const std::string& message) const; + void LogInfo(const std::string& message) const; + void LogWarning(const std::string& message) const; + void LogError(const std::string& message) const; + void LogCommand(const std::vector<std::string>& command) const; // - Utility - bool NameCollisionTest(const std::map<std::string, std::string>& genFiles, - std::multimap<std::string, std::string>& collisions); - bool MakeParentDirectory(const std::string& filename); + bool NameCollisionTest( + const std::map<std::string, std::string>& genFiles, + std::multimap<std::string, std::string>& collisions) const; + std::string ChecksumedPath(const std::string& sourceFile, + const char* basePrefix, + const char* baseSuffix) const; + bool MakeParentDirectory(const std::string& filename) const; + + bool FindHeader(std::string& header, const std::string& testBasePath) const; + bool FindHeaderGlobal(std::string& header, + const std::string& testBasePath) const; + std::string FindMocHeader(const std::string& basePath, + const std::string& baseName, + const std::string& subDir) const; + std::string FindIncludedFile(const std::string& sourceFile, + const std::string& includeString) const; + std::string FindInIncludeDirectories(const std::string& includeString) const; // - Target names std::string OriginTargetName; @@ -125,31 +167,31 @@ private: // - File lists std::vector<std::string> Sources; std::vector<std::string> Headers; + // - Settings + std::string SettingsStringMoc; + std::string SettingsStringUic; + std::string SettingsStringRcc; // - Moc - std::vector<std::string> SkipMoc; - std::string MocCompileDefinitionsStr; - std::string MocIncludesStr; - std::string MocOptionsStr; - std::string OutMocCppFilenameRel; - std::string OutMocCppFilenameAbs; - std::list<std::string> MocIncludes; - std::list<std::string> MocDefinitions; + std::string MocCppFilenameRel; + std::string MocCppFilenameAbs; + std::vector<std::string> MocSkipList; + std::vector<std::string> MocIncludePaths; + std::vector<std::string> MocIncludes; + std::vector<std::string> MocDefinitions; std::vector<std::string> MocOptions; - std::string MocSettingsString; + std::vector<MocDependFilter> MocDependFilters; // - Uic - std::vector<std::string> SkipUic; + std::vector<std::string> UicSkipList; std::vector<std::string> UicTargetOptions; std::map<std::string, std::string> UicOptions; - std::string UicSettingsString; // - Rcc std::vector<std::string> RccSources; std::map<std::string, std::string> RccOptions; std::map<std::string, std::vector<std::string> > RccInputs; - std::string RccSettingsString; // - Utility cmFilePathChecksum fpathCheckSum; - cmsys::RegularExpression RegExpQObject; - cmsys::RegularExpression RegExpQGadget; + std::vector<std::string> HeaderExtensions; + MacroFilter MacroFilters[2]; cmsys::RegularExpression RegExpMocInclude; cmsys::RegularExpression RegExpUicInclude; // - Flags @@ -159,9 +201,9 @@ private: bool RunMocFailed; bool RunUicFailed; bool RunRccFailed; - bool GenerateMocAll; - bool GenerateUicAll; - bool GenerateRccAll; + bool GenerateAllMoc; + bool GenerateAllUic; + bool GenerateAllRcc; bool MocRelaxedMode; }; diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 5555199..631f2a6 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -2,7 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceGroupCommand.h" +#include <set> #include <sstream> +#include <stddef.h> #include "cmMakefile.h" #include "cmSourceGroup.h" diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h deleted file mode 100644 index a2047af..0000000 --- a/Source/cmStandardIncludes.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -/** - * Include header files as a function of the build process, compiler, - * and operating system. - */ -#ifndef cmStandardIncludes_h -#define cmStandardIncludes_h - -#include <cmConfigure.h> - -// Provide fixed-size integer types. -#include <cm_kwiml.h> - -#include <fstream> -#include <iomanip> -#include <iostream> -#include <sstream> - -// we must have stl with the standard include style -#include <algorithm> -#include <functional> -#include <iterator> -#include <map> -#include <set> -#include <string> -#include <vector> - -// include the "c" string header -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#if defined(_MSC_VER) -typedef unsigned short mode_t; -#else -#include <sys/types.h> -#endif - -// use this class to shrink the size of symbols in .o files -// std::string is really basic_string<....lots of stuff....> -// when combined with a map or set, the symbols can be > 2000 chars! -#include <cmsys/String.hxx> -// typedef cmsys::String std::string; - -/* Poison this operator to avoid common mistakes. */ -extern void operator<<(std::ostream&, const std::ostringstream&); - -#include "cmCustomCommandLines.h" -#include "cmDocumentationEntry.h" -#include "cmTargetLinkLibraryType.h" - -#endif diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index c6288a5..80e494b 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -18,6 +18,10 @@ #include "cmVersion.h" #include "cmake.h" +#if !defined(_WIN32) +#include <sys/utsname.h> +#endif + #if defined(__CYGWIN__) #include "cmSystemTools.h" #endif @@ -298,9 +302,15 @@ void cmStateSnapshot::SetDefaultDefinitions() #if defined(_WIN32) this->SetDefinition("WIN32", "1"); this->SetDefinition("CMAKE_HOST_WIN32", "1"); + this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Windows"); #else this->SetDefinition("UNIX", "1"); this->SetDefinition("CMAKE_HOST_UNIX", "1"); + + struct utsname uts_name; + if (uname(&uts_name) == 0) { + this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname); + } #endif #if defined(__CYGWIN__) std::string legacy; diff --git a/Source/cmSubdirDependsCommand.cxx b/Source/cmSubdirDependsCommand.cxx index 36e84d5..0bb2c0a 100644 --- a/Source/cmSubdirDependsCommand.cxx +++ b/Source/cmSubdirDependsCommand.cxx @@ -2,8 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSubdirDependsCommand.h" -#include "cmPolicies.h" - class cmExecutionStatus; bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const&, diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 9efc13b..b7afa10 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -45,6 +45,7 @@ #include <string.h> #include <sys/stat.h> #include <time.h> +#include <utility> #if defined(_WIN32) #include <windows.h> @@ -1978,6 +1979,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) // ??? } #endif + exe_dir = cmSystemTools::GetActualCaseForPath(exe_dir); cmSystemToolsCMakeCommand = exe_dir; cmSystemToolsCMakeCommand += "/cmake"; cmSystemToolsCMakeCommand += cmSystemTools::GetExecutableExtension(); @@ -2015,8 +2017,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0) // Install tree has // - "<prefix><CMAKE_BIN_DIR>/cmake" // - "<prefix><CMAKE_DATA_DIR>" - const std::string actual_case = cmSystemTools::GetActualCaseForPath(exe_dir); - if (cmHasSuffix(actual_case, CMAKE_BIN_DIR)) { + if (cmHasSuffix(exe_dir, CMAKE_BIN_DIR)) { std::string const prefix = exe_dir.substr(0, exe_dir.size() - strlen(CMAKE_BIN_DIR)); cmSystemToolsCMakeRoot = prefix + CMAKE_DATA_DIR; diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 3d57f0e..8ef0958 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -5,7 +5,6 @@ #include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> -#include "cmPolicies.h" #include "cmSystemTools.h" class cmExecutionStatus; diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 9b24a74..37d8bfb 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -5,7 +5,6 @@ #include <string.h> #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmSystemTools.h" diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx index bff6ec5..10b0a88 100644 --- a/Source/cmVariableRequiresCommand.cxx +++ b/Source/cmVariableRequiresCommand.cxx @@ -3,7 +3,6 @@ #include "cmVariableRequiresCommand.h" #include "cmMakefile.h" -#include "cmPolicies.h" #include "cmState.h" #include "cmSystemTools.h" diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index 96e7196..ea44f42 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -48,7 +48,6 @@ set(CMAKE_SYSTEM_NAME) set(CMAKE_SYSTEM_VERSION) set(CMAKE_SYSTEM_PROCESSOR) set(CMAKE_HOST_SYSTEM) -set(CMAKE_HOST_SYSTEM_NAME) set(CMAKE_HOST_SYSTEM_VERSION) set(CMAKE_HOST_SYSTEM_PROCESSOR) diff --git a/Tests/CompileFeatures/.gitattributes b/Tests/CompileFeatures/.gitattributes new file mode 100644 index 0000000..83da28d --- /dev/null +++ b/Tests/CompileFeatures/.gitattributes @@ -0,0 +1,2 @@ +# Do not format a source containing C++11 '>>' syntax as C++98. +cxx_right_angle_brackets.cpp -format.clang-format diff --git a/Tests/PositionIndependentTargets/.gitattributes b/Tests/PositionIndependentTargets/.gitattributes new file mode 100644 index 0000000..ed36631 --- /dev/null +++ b/Tests/PositionIndependentTargets/.gitattributes @@ -0,0 +1,2 @@ +# Do not format a source where we want a long line preserved. +pic_test.h -format.clang-format diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 4b90ad8..260331b 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -46,26 +46,26 @@ endif() get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES) -# -- Test: AUTORCC +# -- Test # RCC only add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) set_property(TARGET rccOnly PROPERTY AUTORCC ON) target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) -# -- Test: AUTORCC +# -- Test # RCC empty add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) set_property(TARGET rccEmpty PROPERTY AUTORCC ON) target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) -# -- Test: AUTOUIC +# -- Test # UIC only qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) set_property(TARGET uicOnly PROPERTY AUTOUIC ON) target_link_libraries(uicOnly ${QT_LIBRARIES}) -# -- Test: AUTOMOC, AUTORCC +# -- Test # Add not_generated_file.qrc to the source list to get the file-level # dependency, but don't generate a c++ file from it. Disable the AUTORCC # feature for this target. This tests that qrc files in the sources don't @@ -80,13 +80,14 @@ set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE) target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES}) target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES}) -# -- Test: AUTORCC +# -- Test # When a file listed in a .qrc file changes the target must be rebuilt try_compile(RCC_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends" "${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends" autorcc_depends - CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + "-DQT_TEST_VERSION=${QT_TEST_VERSION}" "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" OUTPUT_VARIABLE output ) @@ -115,13 +116,14 @@ if (NOT file1_step1 GREATER file1_before) message(SEND_ERROR "file1 (${qrc_file1}) should have changed in the first step!") endif() -# -- Test: AUTOMOC +# -- Test # Ensure a repeated build succeeds when a header containing a QObject changes try_compile(MOC_RERUN "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun" "${CMAKE_CURRENT_SOURCE_DIR}/automoc_rerun" automoc_rerun - CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + "-DQT_TEST_VERSION=${QT_TEST_VERSION}" "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" OUTPUT_VARIABLE output ) @@ -139,7 +141,7 @@ if (automoc_rerun_result) message(SEND_ERROR "Second build of automoc_rerun failed.") endif() -# -- Test: AUTOMOC, SKIP_AUTOMOC +# -- Test # Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target qtx_wrap_cpp(skipMocWrapMoc skipSource/qItemA.hpp @@ -161,7 +163,7 @@ set_property(TARGET skipMocB PROPERTY AUTOMOC ON) set_property(TARGET skipMocB PROPERTY AUTOUIC ON) target_link_libraries(skipMocB ${QT_LIBRARIES}) -# -- Test: AUTOUIC, SKIP_AUTOUIC +# -- Test # Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target set(skipUicSources skipUic.cpp @@ -181,7 +183,7 @@ set_property(TARGET skipUicB PROPERTY AUTOUIC ON) set_property(TARGET skipUicB PROPERTY AUTOMOC ON) target_link_libraries(skipUicB ${QT_LIBRARIES}) -# -- Test: AUTORCC, SKIP_AUTORCC +# -- Test # Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target set(skipRccSources skipRcc.cpp @@ -202,10 +204,73 @@ set_property(TARGET skipRccB PROPERTY AUTOUIC ON) set_property(TARGET skipRccB PROPERTY AUTOMOC ON) target_link_libraries(skipRccB ${QT_LIBRARIES}) -# -- Test: AUTOMOC AUTORCC +# -- Test # Source files with the same basename in different subdirectories add_subdirectory(sameName) -# -- Test: AUTOMOC AUTORCC AUTOUIC +# -- Test +# Tests various include moc patterns +add_subdirectory(mocIncludeStrict) + +# -- Test +# Tests various include moc patterns +add_subdirectory(mocIncludeRelaxed) + +# -- Test +# Tests Q_PLUGIN_METADATA json file change detection +if (NOT QT_TEST_VERSION STREQUAL 4) + try_compile(MOC_PLUGIN + "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin" + "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin" + mocPlugin + CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" + OUTPUT_VARIABLE output + ) + if (NOT MOC_PLUGIN) + message(SEND_ERROR "Initial build of mocPlugin failed. Output: ${output}") + endif() + + set(timeformat "%Y%j%H%M%S") + set(mocPluginBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") + find_library(style_a_file "PluginStyleA" "${mocPluginBinDir}") + find_library(style_b_file "PluginStyleB" "${mocPluginBinDir}") + find_library(style_c_file "PluginStyleC" "${mocPluginBinDir}") + find_library(style_d_file "PluginStyleD" "${mocPluginBinDir}") + + file(TIMESTAMP "${style_a_file}" style_a_before "${timeformat}") + file(TIMESTAMP "${style_b_file}" style_b_before "${timeformat}") + file(TIMESTAMP "${style_c_file}" style_c_before "${timeformat}") + file(TIMESTAMP "${style_d_file}" style_d_before "${timeformat}") + + # Ensure that the timestamp will change and touch the json files + execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) + execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/StyleC.json") + execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${mocPluginBinDir}/jsonFiles/sub/StyleD.json") + + execute_process(COMMAND "${CMAKE_COMMAND}" --build . + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin" + ) + + file(TIMESTAMP "${style_a_file}" style_a_after "${timeformat}") + file(TIMESTAMP "${style_b_file}" style_b_after "${timeformat}") + file(TIMESTAMP "${style_c_file}" style_c_after "${timeformat}") + file(TIMESTAMP "${style_d_file}" style_d_after "${timeformat}") + + if (style_a_after GREATER style_a_before) + message(SEND_ERROR "file (${style_a_file}) should not have changed!") + endif() + if (style_b_after GREATER style_b_before) + message(SEND_ERROR "file (${style_b_file}) should not have changed!") + endif() + if (NOT style_c_after GREATER style_c_before) + message(SEND_ERROR "file (${style_c_file}) should have changed!") + endif() + if (NOT style_d_after GREATER style_d_before) + message(SEND_ERROR "file (${style_d_file}) should have changed!") + endif() +endif() + +# -- Test # Complex test case add_subdirectory(complex) diff --git a/Tests/QtAutogen/mocInclude/ObjA.cpp b/Tests/QtAutogen/mocInclude/ObjA.cpp new file mode 100644 index 0000000..1b0311d --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjA.cpp @@ -0,0 +1,24 @@ +#include "ObjA.hpp" + +class SubObjA : public QObject +{ + Q_OBJECT + +public: + SubObjA() {} + ~SubObjA() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjA::aSlot() +{ +} + +void ObjA::go() +{ + SubObjA subObj; +} + +#include "ObjA.moc" diff --git a/Tests/QtAutogen/mocInclude/ObjA.hpp b/Tests/QtAutogen/mocInclude/ObjA.hpp new file mode 100644 index 0000000..281e90d --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjA.hpp @@ -0,0 +1,13 @@ +#ifndef OBJA_HPP +#define OBJA_HPP + +#include <QObject> + +class ObjA : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; + +#endif diff --git a/Tests/QtAutogen/mocInclude/ObjB.cpp b/Tests/QtAutogen/mocInclude/ObjB.cpp new file mode 100644 index 0000000..5ff315d --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjB.cpp @@ -0,0 +1,25 @@ +#include "ObjB.hpp" + +class SubObjB : public QObject +{ + Q_OBJECT + +public: + SubObjB() {} + ~SubObjB() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjB::aSlot() +{ +} + +void ObjB::go() +{ + SubObjB subObj; +} + +#include "ObjB.moc" +#include "moc_ObjB.cpp" diff --git a/Tests/QtAutogen/mocInclude/ObjB.hpp b/Tests/QtAutogen/mocInclude/ObjB.hpp new file mode 100644 index 0000000..94f3d49 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjB.hpp @@ -0,0 +1,13 @@ +#ifndef OBJB_HPP +#define OBJB_HPP + +#include <QObject> + +class ObjB : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; + +#endif diff --git a/Tests/QtAutogen/mocInclude/ObjC.cpp b/Tests/QtAutogen/mocInclude/ObjC.cpp new file mode 100644 index 0000000..8ca34cb --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjC.cpp @@ -0,0 +1,26 @@ +#include "ObjC.hpp" + +class SubObjC : public QObject +{ + Q_OBJECT + +public: + SubObjC() {} + ~SubObjC() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjC::aSlot() +{ +} + +void ObjC::go() +{ + SubObjC subObj; +} + +#include "ObjC.moc" +// Not the own header +#include "moc_ObjD.cpp" diff --git a/Tests/QtAutogen/mocInclude/ObjC.hpp b/Tests/QtAutogen/mocInclude/ObjC.hpp new file mode 100644 index 0000000..a8e98eb --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjC.hpp @@ -0,0 +1,13 @@ +#ifndef OBJC_HPP +#define OBJC_HPP + +#include <QObject> + +class ObjC : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; + +#endif diff --git a/Tests/QtAutogen/mocInclude/ObjD.cpp b/Tests/QtAutogen/mocInclude/ObjD.cpp new file mode 100644 index 0000000..c18aec1 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjD.cpp @@ -0,0 +1,26 @@ +#include "ObjD.hpp" + +class SubObjD : public QObject +{ + Q_OBJECT + +public: + SubObjD() {} + ~SubObjD() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjD::aSlot() +{ +} + +void ObjD::go() +{ + SubObjD subObj; +} + +#include "ObjD.moc" +// Header in subdirectory +#include "subA/moc_SubObjA.cpp" diff --git a/Tests/QtAutogen/mocInclude/ObjD.hpp b/Tests/QtAutogen/mocInclude/ObjD.hpp new file mode 100644 index 0000000..b6ee098 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/ObjD.hpp @@ -0,0 +1,13 @@ +#ifndef OBJD_HPP +#define OBJD_HPP + +#include <QObject> + +class ObjD : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; + +#endif diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp new file mode 100644 index 0000000..a05f6e3 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subA/SubObjA.cpp @@ -0,0 +1,27 @@ +#include "SubObjA.hpp" + +namespace subA { + +class SubObjA : public QObject +{ + Q_OBJECT + +public: + SubObjA() {} + ~SubObjA() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjA::aSlot() +{ +} + +void ObjA::go() +{ + SubObjA subObj; +} +} + +#include "SubObjA.moc" diff --git a/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp b/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp new file mode 100644 index 0000000..31a18b6 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subA/SubObjA.hpp @@ -0,0 +1,16 @@ +#ifndef SUBOBJA_HPP +#define SUBOBJA_HPP + +#include <QObject> + +namespace subA { + +class ObjA : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp new file mode 100644 index 0000000..1e77639 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subB/SubObjB.cpp @@ -0,0 +1,27 @@ +#include "SubObjB.hpp" + +namespace subB { + +class SubObjB : public QObject +{ + Q_OBJECT + +public: + SubObjB() {} + ~SubObjB() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjB::aSlot() +{ +} + +void ObjB::go() +{ + SubObjB subObj; +} +} + +#include "SubObjB.moc" diff --git a/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp b/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp new file mode 100644 index 0000000..3f29fa2 --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subB/SubObjB.hpp @@ -0,0 +1,16 @@ +#ifndef SUBOBJB_HPP +#define SUBOBJB_HPP + +#include <QObject> + +namespace subB { + +class ObjB : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp new file mode 100644 index 0000000..c2d94ef --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subC/SubObjC.cpp @@ -0,0 +1,27 @@ +#include "SubObjC.hpp" + +namespace subC { + +class SubObjC : public QObject +{ + Q_OBJECT + +public: + SubObjC() {} + ~SubObjC() {} + + Q_SLOT + void aSlot(); +}; + +void SubObjC::aSlot() +{ +} + +void ObjC::go() +{ + SubObjC subObj; +} +} + +#include "SubObjC.moc" diff --git a/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp b/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp new file mode 100644 index 0000000..dc251fd --- /dev/null +++ b/Tests/QtAutogen/mocInclude/subC/SubObjC.hpp @@ -0,0 +1,16 @@ +#ifndef SUBOBJC_HPP +#define SUBOBJC_HPP + +#include <QObject> + +namespace subC { + +class ObjC : public QObject +{ + Q_OBJECT + Q_SLOT + void go(); +}; +} + +#endif diff --git a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt new file mode 100644 index 0000000..6a0829d --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt @@ -0,0 +1,18 @@ +# Test moc include patterns + +set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) + +include_directories("../mocInclude") + +add_executable(mocIncludeRelaxed + ../mocInclude/ObjA.cpp + ../mocInclude/ObjB.cpp + ../mocInclude/ObjC.cpp + ../mocInclude/ObjD.cpp + ../mocInclude/subA/SubObjA.cpp + ../mocInclude/subB/SubObjB.cpp + ../mocInclude/subC/SubObjC.cpp + main.cpp +) +target_link_libraries(mocIncludeRelaxed ${QT_LIBRARIES}) +set_target_properties(mocIncludeRelaxed PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp new file mode 100644 index 0000000..142d59e --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp @@ -0,0 +1,14 @@ +#include "ObjA.hpp" +#include "ObjB.hpp" +#include "ObjC.hpp" + +int main(int argv, char** args) +{ + ObjA objA; + ObjB objB; + ObjC objC; + return 0; +} + +// Header in global subdirectory +#include "subB/moc_SubObjB.cpp" diff --git a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt new file mode 100644 index 0000000..22e93a8 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt @@ -0,0 +1,18 @@ +# Test moc include patterns + +set(CMAKE_AUTOMOC_RELAXED_MODE FALSE) + +include_directories("../mocInclude") + +add_executable(mocIncludeStrict + ../mocInclude/ObjA.cpp + ../mocInclude/ObjB.cpp + ../mocInclude/ObjC.cpp + ../mocInclude/ObjD.cpp + ../mocInclude/subA/SubObjA.cpp + ../mocInclude/subB/SubObjB.cpp + ../mocInclude/subC/SubObjC.cpp + main.cpp +) +target_link_libraries(mocIncludeStrict ${QT_LIBRARIES}) +set_target_properties(mocIncludeStrict PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/mocIncludeStrict/main.cpp b/Tests/QtAutogen/mocIncludeStrict/main.cpp new file mode 100644 index 0000000..142d59e --- /dev/null +++ b/Tests/QtAutogen/mocIncludeStrict/main.cpp @@ -0,0 +1,14 @@ +#include "ObjA.hpp" +#include "ObjB.hpp" +#include "ObjC.hpp" + +int main(int argv, char** args) +{ + ObjA objA; + ObjB objB; + ObjC objC; + return 0; +} + +// Header in global subdirectory +#include "subB/moc_SubObjB.cpp" diff --git a/Tests/QtAutogen/mocPlugin/CMakeLists.txt b/Tests/QtAutogen/mocPlugin/CMakeLists.txt new file mode 100644 index 0000000..eed7d39 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.8) + +if (NOT QT_TEST_VERSION STREQUAL 5) + message(SEND_ERROR "Invalid Qt version specified.") +endif() +find_package(Qt5Widgets REQUIRED) + +if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) + add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) +endif() + +configure_file(jsonIn/StyleC.json jsonFiles/StyleC.json @ONLY) +configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD.json @ONLY) + +# Enable automoc +set(CMAKE_AUTOMOC TRUE) + +include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles") +link_libraries(Qt5::Widgets) + +add_library(PluginStyleA MODULE StyleA.cpp) +add_library(PluginStyleB MODULE StyleB.cpp) +add_library(PluginStyleC MODULE StyleC.cpp) +add_library(PluginStyleD MODULE StyleD.cpp) +add_library(PluginStyleE MODULE StyleE.cpp) diff --git a/Tests/QtAutogen/mocPlugin/StyleA.cpp b/Tests/QtAutogen/mocPlugin/StyleA.cpp new file mode 100644 index 0000000..b5e8753 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleA.cpp @@ -0,0 +1,6 @@ +#include "StyleA.hpp" + +QStyle* StyleA::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/StyleA.hpp b/Tests/QtAutogen/mocPlugin/StyleA.hpp new file mode 100644 index 0000000..b105b02 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleA.hpp @@ -0,0 +1,15 @@ +#ifndef STYLEA_HPP +#define STYLEA_HPP + +#include <QStylePlugin> + +class StyleA : public QStylePlugin +{ + Q_OBJECT + // Json file in local directory + Q_PLUGIN_METADATA(IID "org.styles.A" FILE "StyleA.json") +public: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/mocPlugin/StyleA.json b/Tests/QtAutogen/mocPlugin/StyleA.json new file mode 100644 index 0000000..cc33953 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleA.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogen/mocPlugin/StyleB.cpp b/Tests/QtAutogen/mocPlugin/StyleB.cpp new file mode 100644 index 0000000..17d4400 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleB.cpp @@ -0,0 +1,6 @@ +#include "StyleB.hpp" + +QStyle* StyleB::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/StyleB.hpp b/Tests/QtAutogen/mocPlugin/StyleB.hpp new file mode 100644 index 0000000..ba89127 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleB.hpp @@ -0,0 +1,15 @@ +#ifndef STYLEB_HPP +#define STYLEB_HPP + +#include <QStylePlugin> + +class StyleB : public QStylePlugin +{ + Q_OBJECT + // Json file in local subdirectory + Q_PLUGIN_METADATA(IID "org.styles.B" FILE "jsonIn/StyleB.json") +public: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/mocPlugin/StyleC.cpp b/Tests/QtAutogen/mocPlugin/StyleC.cpp new file mode 100644 index 0000000..37e7564 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleC.cpp @@ -0,0 +1,6 @@ +#include "StyleC.hpp" + +QStyle* StyleC::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/StyleC.hpp b/Tests/QtAutogen/mocPlugin/StyleC.hpp new file mode 100644 index 0000000..9f71d75 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleC.hpp @@ -0,0 +1,15 @@ +#ifndef STYLEC_HPP +#define STYLEC_HPP + +#include <QStylePlugin> + +class StyleC : public QStylePlugin +{ + Q_OBJECT + // Json file in global root directory + Q_PLUGIN_METADATA(IID "org.styles.C" FILE "StyleC.json") +public: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/mocPlugin/StyleD.cpp b/Tests/QtAutogen/mocPlugin/StyleD.cpp new file mode 100644 index 0000000..7e4b121 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleD.cpp @@ -0,0 +1,6 @@ +#include "StyleD.hpp" + +QStyle* StyleD::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/StyleD.hpp b/Tests/QtAutogen/mocPlugin/StyleD.hpp new file mode 100644 index 0000000..e58444d --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleD.hpp @@ -0,0 +1,15 @@ +#ifndef STYLED_HPP +#define STYLED_HPP + +#include <QStylePlugin> + +class StyleD : public QStylePlugin +{ + Q_OBJECT + // Json file in global sub director + Q_PLUGIN_METADATA(IID "org.styles.D" FILE "sub/StyleD.json") +public: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/mocPlugin/StyleE.cpp b/Tests/QtAutogen/mocPlugin/StyleE.cpp new file mode 100644 index 0000000..8fc9a7f --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleE.cpp @@ -0,0 +1,6 @@ +#include "StyleE.hpp" + +QStyle* StyleE::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/mocPlugin/StyleE.hpp b/Tests/QtAutogen/mocPlugin/StyleE.hpp new file mode 100644 index 0000000..80e0b79 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleE.hpp @@ -0,0 +1,15 @@ +#ifndef STYLEE_HPP +#define STYLEE_HPP + +#include <QStylePlugin> + +class StyleE : public QStylePlugin +{ + Q_OBJECT + // No Json file + Q_PLUGIN_METADATA(IID "org.styles.E") +public: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json new file mode 100644 index 0000000..129cac4 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleB.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "StarbusterB" ] } diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json new file mode 100644 index 0000000..bf17580 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleC.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "StarbusterC" ] } diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json new file mode 100644 index 0000000..f7fcc19 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleD.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "StarbusterD" ] } diff --git a/Tests/QtAutogen/mocPlugin/main.cpp b/Tests/QtAutogen/mocPlugin/main.cpp new file mode 100644 index 0000000..3ba2ddc --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/main.cpp @@ -0,0 +1,6 @@ +#include "StyleA.hpp" + +int main(int argv, char** args) +{ + return 0; +} diff --git a/Tests/QtAutogen/sameName/CMakeLists.txt b/Tests/QtAutogen/sameName/CMakeLists.txt index 9e47a3e..4d2dcd9 100644 --- a/Tests/QtAutogen/sameName/CMakeLists.txt +++ b/Tests/QtAutogen/sameName/CMakeLists.txt @@ -18,3 +18,14 @@ add_executable(sameName ) target_link_libraries(sameName ${QT_LIBRARIES}) set_target_properties(sameName PROPERTIES AUTOMOC TRUE AUTORCC TRUE) + +# Set different compression levels +if (QT_TEST_VERSION STREQUAL 4) + set(rccCompress "-compress") +else() + set(rccCompress "--compress") +endif() +set_target_properties(sameName PROPERTIES AUTORCC_OPTIONS "${rccCompress};0" ) +set_source_files_properties(aaa/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};1" ) +set_source_files_properties(bbb/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};2" ) +set_source_files_properties(ccc/data.qrc PROPERTIES AUTORCC_OPTIONS "${rccCompress};3" ) diff --git a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes new file mode 100644 index 0000000..9c22288 --- /dev/null +++ b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes @@ -0,0 +1,2 @@ +# Do not format a source encoded in UTF-16. +test_UTF-16LE.h -format.clang-format diff --git a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes new file mode 100644 index 0000000..883a7f1 --- /dev/null +++ b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes @@ -0,0 +1,2 @@ +# Exclude reference content from formatting. +* -format.clang-format diff --git a/Utilities/.gitattributes b/Utilities/.gitattributes index c6345eb..bd97802 100644 --- a/Utilities/.gitattributes +++ b/Utilities/.gitattributes @@ -1,3 +1,7 @@ /Git export-ignore /GitSetup export-ignore SetupForDevelopment.sh export-ignore + +# Do not format third-party sources. +/KWIML/** -format.clang-format +/cm*/** -format.clang-format diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index 2b36ac5..edcda77 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash #============================================================================= -# Copyright 2015-2016 Kitware, Inc. +# Copyright 2015-2017 Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -106,34 +106,12 @@ case "$mode" in *) die "invalid mode: $mode" ;; esac -# Filter sources to which our style should apply. -$git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' '*.cu' '*.notcu' | +# List files as selected above. +$git_ls | - # Exclude lexer/parser generator input and output. - egrep -z -v '^Source/cmCommandArgumentLexer\.' | - egrep -z -v '^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)' | - egrep -z -v '^Source/cmDependsJavaLexer\.' | - egrep -z -v '^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)' | - egrep -z -v '^Source/cmExprLexer\.' | - egrep -z -v '^Source/cmExprParser(\.y|\.cxx|Tokens\.h)' | - egrep -z -v '^Source/cmFortranLexer\.' | - egrep -z -v '^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)' | - egrep -z -v '^Source/cmListFileLexer(\.in\.l|\.c)' | - - # Exclude third-party sources. - egrep -z -v '^Source/bindexplib' | - egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | - egrep -z -v '^Utilities/(KW|cm).*/' | - - # Exclude reference content. - egrep -z -v '^Tests/RunCMake/GenerateExportHeader/reference/' | - - # Exclude manually-formatted sources (e.g. with long lines). - egrep -z -v '^Tests/PositionIndependentTargets/pic_test.h' | - egrep -z -v '^Tests/CompileFeatures/cxx_right_angle_brackets.cpp' | - - # Exclude sources with encoding not suported by clang-format. - egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | + # Select sources with our attribute. + git check-attr --stdin format.clang-format | + sed -n '/: format\.clang-format: set$/ {s/:[^:]*:[^:]*$//p}' | # Update sources in-place. - xargs -0 "$clang_format" -i + xargs -d '\n' "$clang_format" -i diff --git a/Utilities/cmlibuv/include/pthread-barrier.h b/Utilities/cmlibuv/include/pthread-barrier.h index 3e01705..900ebed 100644 --- a/Utilities/cmlibuv/include/pthread-barrier.h +++ b/Utilities/cmlibuv/include/pthread-barrier.h @@ -18,7 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define _UV_PTHREAD_BARRIER_ #include <errno.h> #include <pthread.h> +#if !defined(__MVS__) #include <semaphore.h> /* sem_t */ +#endif #define PTHREAD_BARRIER_SERIAL_THREAD 0x12345 diff --git a/Utilities/cmlibuv/include/uv-os390.h b/Utilities/cmlibuv/include/uv-os390.h index b0b068f..58f9261 100644 --- a/Utilities/cmlibuv/include/uv-os390.h +++ b/Utilities/cmlibuv/include/uv-os390.h @@ -24,4 +24,7 @@ #define UV_PLATFORM_SEM_T int +#define UV_PLATFORM_LOOP_FIELDS \ + void* ep; \ + #endif /* UV_MVS_H */ diff --git a/Utilities/cmlibuv/include/uv-unix.h b/Utilities/cmlibuv/include/uv-unix.h index bca2714..3030f71 100644 --- a/Utilities/cmlibuv/include/uv-unix.h +++ b/Utilities/cmlibuv/include/uv-unix.h @@ -36,7 +36,9 @@ #include <termios.h> #include <pwd.h> +#if !defined(__MVS__) #include <semaphore.h> +#endif #include <pthread.h> #include <signal.h> @@ -44,6 +46,8 @@ #if defined(__linux__) # include "uv-linux.h" +#elif defined (__MVS__) +# include "uv-os390.h" #elif defined(_AIX) # include "uv-aix.h" #elif defined(__sun) diff --git a/Utilities/cmlibuv/include/uv-version.h b/Utilities/cmlibuv/include/uv-version.h index 3cb9b5f..e165809 100644 --- a/Utilities/cmlibuv/include/uv-version.h +++ b/Utilities/cmlibuv/include/uv-version.h @@ -31,8 +31,8 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 9 -#define UV_VERSION_PATCH 2 +#define UV_VERSION_MINOR 11 +#define UV_VERSION_PATCH 1 #define UV_VERSION_IS_RELEASE 0 #define UV_VERSION_SUFFIX "dev" diff --git a/Utilities/cmlibuv/include/uv-win.h b/Utilities/cmlibuv/include/uv-win.h index 89ee09a..d3e32a5 100644 --- a/Utilities/cmlibuv/include/uv-win.h +++ b/Utilities/cmlibuv/include/uv-win.h @@ -49,6 +49,7 @@ typedef struct pollfd { #include <process.h> #include <signal.h> +#include <fcntl.h> #include <sys/stat.h> #if defined(_MSC_VER) && _MSC_VER < 1600 diff --git a/Utilities/cmlibuv/include/uv.h b/Utilities/cmlibuv/include/uv.h index e3e20dc..5879764 100644 --- a/Utilities/cmlibuv/include/uv.h +++ b/Utilities/cmlibuv/include/uv.h @@ -367,6 +367,8 @@ typedef enum { } uv_membership; +UV_EXTERN int uv_translate_sys_error(int sys_errno); + UV_EXTERN const char* uv_strerror(int err); UV_EXTERN const char* uv_err_name(int err); diff --git a/Utilities/cmlibuv/src/unix/aix.c b/Utilities/cmlibuv/src/unix/aix.c index 652cd98..1d2cd4a 100644 --- a/Utilities/cmlibuv/src/unix/aix.c +++ b/Utilities/cmlibuv/src/unix/aix.c @@ -64,6 +64,11 @@ #define RDWR_BUF_SIZE 4096 #define EQ(a,b) (strcmp(a,b) == 0) +static void* args_mem = NULL; +static char** process_argv = NULL; +static int process_argc = 0; +static char* process_title_ptr = NULL; + int uv__platform_loop_init(uv_loop_t* loop) { loop->fs_fd = -1; @@ -753,6 +758,13 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file"); + /* In file / directory move cases, AIX Event infrastructure + * produces a second event with no data. + * Ignore it and return gracefully. + */ + if(bytes == 0) + return; + /* Parse the data */ if(bytes > 0) rc = uv__parse_data(result_data, &events, handle); @@ -881,24 +893,94 @@ void uv__fs_event_close(uv_fs_event_t* handle) { char** uv_setup_args(int argc, char** argv) { - return argv; + char** new_argv; + size_t size; + char* s; + int i; + + if (argc <= 0) + return argv; + + /* Save the original pointer to argv. + * AIX uses argv to read the process name. + * (Not the memory pointed to by argv[0..n] as on Linux.) + */ + process_argv = argv; + process_argc = argc; + + /* Calculate how much memory we need for the argv strings. */ + size = 0; + for (i = 0; i < argc; i++) + size += strlen(argv[i]) + 1; + + /* Add space for the argv pointers. */ + size += (argc + 1) * sizeof(char*); + + new_argv = uv__malloc(size); + if (new_argv == NULL) + return argv; + args_mem = new_argv; + + /* Copy over the strings and set up the pointer table. */ + s = (char*) &new_argv[argc + 1]; + for (i = 0; i < argc; i++) { + size = strlen(argv[i]) + 1; + memcpy(s, argv[i], size); + new_argv[i] = s; + s += size; + } + new_argv[i] = NULL; + + return new_argv; } int uv_set_process_title(const char* title) { + char* new_title; + + /* We cannot free this pointer when libuv shuts down, + * the process may still be using it. + */ + new_title = uv__strdup(title); + if (new_title == NULL) + return -ENOMEM; + + /* If this is the first time this is set, + * don't free and set argv[1] to NULL. + */ + if (process_title_ptr != NULL) + uv__free(process_title_ptr); + + process_title_ptr = new_title; + + process_argv[0] = process_title_ptr; + if (process_argc > 1) + process_argv[1] = NULL; + return 0; } int uv_get_process_title(char* buffer, size_t size) { + size_t len; + len = strlen(process_argv[0]); if (buffer == NULL || size == 0) return -EINVAL; + else if (size <= len) + return -ENOBUFS; + + memcpy(buffer, process_argv[0], len + 1); - buffer[0] = '\0'; return 0; } +UV_DESTRUCTOR(static void free_args_mem(void)) { + uv__free(args_mem); /* Keep valgrind happy. */ + args_mem = NULL; +} + + int uv_resident_set_memory(size_t* rss) { char pp[64]; psinfo_t psinfo; diff --git a/Utilities/cmlibuv/src/unix/atomic-ops.h b/Utilities/cmlibuv/src/unix/atomic-ops.h index 815e355..9dac255 100644 --- a/Utilities/cmlibuv/src/unix/atomic-ops.h +++ b/Utilities/cmlibuv/src/unix/atomic-ops.h @@ -43,8 +43,12 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { __compare_and_swap(ptr, &oldval, newval); return out; #elif defined(__MVS__) - return __plo_CS(ptr, (unsigned int*) ptr, - oldval, (unsigned int*) &newval); + unsigned int op4; + if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, + (unsigned int*) ptr, *ptr, &op4)) + return oldval; + else + return op4; #else return __sync_val_compare_and_swap(ptr, oldval, newval); #endif @@ -67,13 +71,18 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) { # endif /* if defined(__64BIT__) */ return out; #elif defined (__MVS__) -# ifdef _LP64 - return __plo_CSGR(ptr, (unsigned long long*) ptr, - oldval, (unsigned long long*) &newval); -# else - return __plo_CS(ptr, (unsigned int*) ptr, - oldval, (unsigned int*) &newval); -# endif +#ifdef _LP64 + unsigned long long op4; + if (__plo_CSSTGR(ptr, (unsigned long long*) &oldval, newval, + (unsigned long long*) ptr, *ptr, &op4)) +#else + unsigned long op4; + if (__plo_CSST(ptr, (unsigned int*) &oldval, newval, + (unsigned int*) ptr, *ptr, &op4)) +#endif + return oldval; + else + return op4; #else return __sync_val_compare_and_swap(ptr, oldval, newval); #endif diff --git a/Utilities/cmlibuv/src/unix/core.c b/Utilities/cmlibuv/src/unix/core.c index d88fc1d..9ef7134 100644 --- a/Utilities/cmlibuv/src/unix/core.c +++ b/Utilities/cmlibuv/src/unix/core.c @@ -98,7 +98,7 @@ uint64_t uv_hrtime(void) { void uv_close(uv_handle_t* handle, uv_close_cb close_cb) { - assert(!(handle->flags & (UV_CLOSING | UV_CLOSED))); + assert(!uv__is_closing(handle)); handle->flags |= UV_CLOSING; handle->close_cb = close_cb; @@ -517,6 +517,9 @@ int uv__close_nocheckstdio(int fd) { int uv__close(int fd) { assert(fd > STDERR_FILENO); /* Catch stdio close bugs. */ +#if defined(__MVS__) + epoll_file_close(fd); +#endif return uv__close_nocheckstdio(fd); } @@ -836,13 +839,8 @@ void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events) { * every tick of the event loop but the other backends allow us to * short-circuit here if the event mask is unchanged. */ - if (w->events == w->pevents) { - if (w->events == 0 && !QUEUE_EMPTY(&w->watcher_queue)) { - QUEUE_REMOVE(&w->watcher_queue); - QUEUE_INIT(&w->watcher_queue); - } + if (w->events == w->pevents) return; - } #endif if (QUEUE_EMPTY(&w->watcher_queue)) @@ -1236,3 +1234,9 @@ void uv_os_free_passwd(uv_passwd_t* pwd) { int uv_os_get_passwd(uv_passwd_t* pwd) { return uv__getpwuid_r(pwd); } + + +int uv_translate_sys_error(int sys_errno) { + /* If < 0 then it's already a libuv error. */ + return sys_errno <= 0 ? sys_errno : -sys_errno; +} diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c index 3d478b7..f9513ea 100644 --- a/Utilities/cmlibuv/src/unix/fs.c +++ b/Utilities/cmlibuv/src/unix/fs.c @@ -129,8 +129,23 @@ static ssize_t uv__fs_fdatasync(uv_fs_t* req) { #if defined(__linux__) || defined(__sun) || defined(__NetBSD__) return fdatasync(req->file); -#elif defined(__APPLE__) && defined(SYS_fdatasync) - return syscall(SYS_fdatasync, req->file); +#elif defined(__APPLE__) + /* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache + * to the drive platters. This is in contrast to Linux's fdatasync and fsync + * which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent + * for flushing buffered data to permanent storage. + */ + return fcntl(req->file, F_FULLFSYNC); +#else + return fsync(req->file); +#endif +} + + +static ssize_t uv__fs_fsync(uv_fs_t* req) { +#if defined(__APPLE__) + /* See the comment in uv__fs_fdatasync. */ + return fcntl(req->file, F_FULLFSYNC); #else return fsync(req->file); #endif @@ -365,7 +380,6 @@ static int uv__fs_scandir_sort(UV_CONST_DIRENT** a, UV_CONST_DIRENT** b) { static ssize_t uv__fs_scandir(uv_fs_t* req) { uv__dirent_t **dents; - int saved_errno; int n; dents = NULL; @@ -374,28 +388,17 @@ static ssize_t uv__fs_scandir(uv_fs_t* req) { /* NOTE: We will use nbufs as an index field */ req->nbufs = 0; - if (n == 0) - goto out; /* osx still needs to deallocate some memory */ - else if (n == -1) - return n; - - req->ptr = dents; - - return n; - -out: - saved_errno = errno; - if (dents != NULL) { - int i; - - /* Memory was allocated using the system allocator, so use free() here. */ - for (i = 0; i < n; i++) - free(dents[i]); + if (n == 0) { + /* OS X still needs to deallocate some memory. + * Memory was allocated using the system allocator, so use free() here. + */ free(dents); + dents = NULL; + } else if (n == -1) { + return n; } - errno = saved_errno; - req->ptr = NULL; + req->ptr = dents; return n; } @@ -798,6 +801,10 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) { dst->st_flags = 0; dst->st_gen = 0; #elif !defined(_AIX) && ( \ + defined(__DragonFly__) || \ + defined(__FreeBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) || \ defined(_GNU_SOURCE) || \ defined(_BSD_SOURCE) || \ defined(_SVID_SOURCE) || \ @@ -809,9 +816,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) { dst->st_mtim.tv_nsec = src->st_mtim.tv_nsec; dst->st_ctim.tv_sec = src->st_ctim.tv_sec; dst->st_ctim.tv_nsec = src->st_ctim.tv_nsec; -# if defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__OpenBSD__) || \ +# if defined(__FreeBSD__) || \ defined(__NetBSD__) dst->st_birthtim.tv_sec = src->st_birthtim.tv_sec; dst->st_birthtim.tv_nsec = src->st_birthtim.tv_nsec; @@ -945,7 +950,7 @@ static void uv__fs_work(struct uv__work* w) { X(FCHOWN, fchown(req->file, req->uid, req->gid)); X(FDATASYNC, uv__fs_fdatasync(req)); X(FSTAT, uv__fs_fstat(req->file, &req->statbuf)); - X(FSYNC, fsync(req->file)); + X(FSYNC, uv__fs_fsync(req)); X(FTRUNCATE, ftruncate(req->file, req->off)); X(FUTIME, uv__fs_futime(req)); X(LSTAT, uv__fs_lstat(req->path, &req->statbuf)); diff --git a/Utilities/cmlibuv/src/unix/internal.h b/Utilities/cmlibuv/src/unix/internal.h index 2570026..b48f8fa 100644 --- a/Utilities/cmlibuv/src/unix/internal.h +++ b/Utilities/cmlibuv/src/unix/internal.h @@ -38,6 +38,10 @@ # include "linux-syscalls.h" #endif /* __linux__ */ +#if defined(__MVS__) +# include "os390-syscalls.h" +#endif /* __MVS__ */ + #if defined(__sun) # include <sys/port.h> # include <port.h> @@ -51,6 +55,10 @@ # include <poll.h> #endif /* _AIX */ +#if defined(__APPLE__) && !TARGET_OS_IPHONE +# include <AvailabilityMacros.h> +#endif + #if defined(__ANDROID__) int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); # ifdef pthread_sigmask @@ -154,7 +162,8 @@ struct uv__stream_queued_fds_s { defined(__DragonFly__) || \ defined(__FreeBSD__) || \ defined(__FreeBSD_kernel__) || \ - defined(__linux__) + defined(__linux__) || \ + defined(__OpenBSD__) #define uv__cloexec uv__cloexec_ioctl #define uv__nonblock uv__nonblock_ioctl #else @@ -268,7 +277,6 @@ int uv__make_socketpair(int fds[2], int flags); int uv__make_pipe(int fds[2], int flags); #if defined(__APPLE__) -#include <AvailabilityMacros.h> int uv__fsevents_init(uv_fs_event_t* handle); int uv__fsevents_close(uv_fs_event_t* handle); diff --git a/Utilities/cmlibuv/src/unix/openbsd.c b/Utilities/cmlibuv/src/unix/openbsd.c index 909288c..ac28b69 100644 --- a/Utilities/cmlibuv/src/unix/openbsd.c +++ b/Utilities/cmlibuv/src/unix/openbsd.c @@ -163,7 +163,7 @@ char** uv_setup_args(int argc, char** argv) { int uv_set_process_title(const char* title) { uv__free(process_title); process_title = uv__strdup(title); - setproctitle(title); + setproctitle("%s", title); return 0; } diff --git a/Utilities/cmlibuv/src/unix/os390-syscalls.c b/Utilities/cmlibuv/src/unix/os390-syscalls.c new file mode 100644 index 0000000..2bf3b73 --- /dev/null +++ b/Utilities/cmlibuv/src/unix/os390-syscalls.c @@ -0,0 +1,334 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + + +#include "os390-syscalls.h" +#include <errno.h> +#include <stdlib.h> +#include <assert.h> +#include <search.h> + +#define CW_CONDVAR 32 + +#pragma linkage(BPX4CTW, OS) +#pragma linkage(BPX1CTW, OS) + +static int number_of_epolls; +static QUEUE global_epoll_queue; +static uv_mutex_t global_epoll_lock; +static uv_once_t once = UV_ONCE_INIT; + +int scandir(const char* maindir, struct dirent*** namelist, + int (*filter)(const struct dirent*), + int (*compar)(const struct dirent**, + const struct dirent **)) { + struct dirent** nl; + struct dirent* dirent; + unsigned count; + size_t allocated; + DIR* mdir; + + nl = NULL; + count = 0; + allocated = 0; + mdir = opendir(maindir); + if (!mdir) + return -1; + + while (1) { + dirent = readdir(mdir); + if (!dirent) + break; + if (!filter || filter(dirent)) { + struct dirent* copy; + copy = uv__malloc(sizeof(*copy)); + if (!copy) { + while (count) { + dirent = nl[--count]; + uv__free(dirent); + } + uv__free(nl); + closedir(mdir); + errno = ENOMEM; + return -1; + } + memcpy(copy, dirent, sizeof(*copy)); + + nl = uv__realloc(nl, sizeof(*copy) * (count + 1)); + nl[count++] = copy; + } + } + + qsort(nl, count, sizeof(struct dirent *), + (int (*)(const void *, const void *)) compar); + + closedir(mdir); + + *namelist = nl; + return count; +} + + +static unsigned int next_power_of_two(unsigned int val) { + val -= 1; + val |= val >> 1; + val |= val >> 2; + val |= val >> 4; + val |= val >> 8; + val |= val >> 16; + val += 1; + return val; +} + + +static void maybe_resize(uv__os390_epoll* lst, unsigned int len) { + unsigned int newsize; + unsigned int i; + struct pollfd* newlst; + + if (len <= lst->size) + return; + + newsize = next_power_of_two(len); + newlst = uv__realloc(lst->items, newsize * sizeof(lst->items[0])); + + if (newlst == NULL) + abort(); + for (i = lst->size; i < newsize; ++i) + newlst[i].fd = -1; + + lst->items = newlst; + lst->size = newsize; +} + + +static void epoll_init() { + QUEUE_INIT(&global_epoll_queue); + if (uv_mutex_init(&global_epoll_lock)) + abort(); +} + + +uv__os390_epoll* epoll_create1(int flags) { + uv__os390_epoll* lst; + + uv_once(&once, epoll_init); + uv_mutex_lock(&global_epoll_lock); + lst = uv__malloc(sizeof(*lst)); + if (lst == -1) + return NULL; + QUEUE_INSERT_TAIL(&global_epoll_queue, &lst->member); + uv_mutex_unlock(&global_epoll_lock); + + /* initialize list */ + lst->size = 0; + lst->items = NULL; + return lst; +} + + +int epoll_ctl(uv__os390_epoll* lst, + int op, + int fd, + struct epoll_event *event) { + if(op == EPOLL_CTL_DEL) { + if (fd >= lst->size || lst->items[fd].fd == -1) { + errno = ENOENT; + return -1; + } + lst->items[fd].fd = -1; + } else if(op == EPOLL_CTL_ADD) { + maybe_resize(lst, fd + 1); + if (lst->items[fd].fd != -1) { + errno = EEXIST; + return -1; + } + lst->items[fd].fd = fd; + lst->items[fd].events = event->events; + } else if(op == EPOLL_CTL_MOD) { + if (fd >= lst->size || lst->items[fd].fd == -1) { + errno = ENOENT; + return -1; + } + lst->items[fd].events = event->events; + } else + abort(); + + return 0; +} + + +int epoll_wait(uv__os390_epoll* lst, struct epoll_event* events, + int maxevents, int timeout) { + size_t size; + struct pollfd* pfds; + int pollret; + int reventcount; + + uv_mutex_lock(&global_epoll_lock); + uv_mutex_unlock(&global_epoll_lock); + size = lst->size; + pfds = lst->items; + pollret = poll(pfds, size, timeout); + if(pollret == -1) + return pollret; + + reventcount = 0; + for (int i = 0; i < lst->size && i < maxevents; ++i) { + struct epoll_event ev; + + ev.events = 0; + ev.fd = pfds[i].fd; + if(!pfds[i].revents) + continue; + + if(pfds[i].revents & POLLRDNORM) + ev.events = ev.events | POLLIN; + + if(pfds[i].revents & POLLWRNORM) + ev.events = ev.events | POLLOUT; + + if(pfds[i].revents & POLLHUP) + ev.events = ev.events | POLLHUP; + + pfds[i].revents = 0; + events[reventcount++] = ev; + } + + return reventcount; +} + + +int epoll_file_close(int fd) { + QUEUE* q; + + uv_once(&once, epoll_init); + uv_mutex_lock(&global_epoll_lock); + QUEUE_FOREACH(q, &global_epoll_queue) { + uv__os390_epoll* lst; + + lst = QUEUE_DATA(q, uv__os390_epoll, member); + if (fd < lst->size && lst->items != NULL && lst->items[fd].fd != -1) + lst->items[fd].fd = -1; + } + + uv_mutex_unlock(&global_epoll_lock); + return 0; +} + +void epoll_queue_close(uv__os390_epoll* lst) { + uv_mutex_lock(&global_epoll_lock); + QUEUE_REMOVE(&lst->member); + uv_mutex_unlock(&global_epoll_lock); + uv__free(lst->items); + lst->items = NULL; +} + + +int nanosleep(const struct timespec* req, struct timespec* rem) { + unsigned nano; + unsigned seconds; + unsigned events; + unsigned secrem; + unsigned nanorem; + int rv; + int rc; + int rsn; + + nano = (int)req->tv_nsec; + seconds = req->tv_sec; + events = CW_CONDVAR; + +#if defined(_LP64) + BPX4CTW(&seconds, &nano, &events, &secrem, &nanorem, &rv, &rc, &rsn); +#else + BPX1CTW(&seconds, &nano, &events, &secrem, &nanorem, &rv, &rc, &rsn); +#endif + + assert(rv == -1 && errno == EAGAIN); + + if(rem != NULL) { + rem->tv_nsec = nanorem; + rem->tv_sec = secrem; + } + + return 0; +} + + +char* mkdtemp(char* path) { + static const char* tempchars = + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + static const size_t num_chars = 62; + static const size_t num_x = 6; + char *ep, *cp; + unsigned int tries, i; + size_t len; + uint64_t v; + int fd; + int retval; + int saved_errno; + + len = strlen(path); + ep = path + len; + if (len < num_x || strncmp(ep - num_x, "XXXXXX", num_x)) { + errno = EINVAL; + return NULL; + } + + fd = open("/dev/urandom", O_RDONLY); + if (fd == -1) + return NULL; + + tries = TMP_MAX; + retval = -1; + do { + if (read(fd, &v, sizeof(v)) != sizeof(v)) + break; + + cp = ep - num_x; + for (i = 0; i < num_x; i++) { + *cp++ = tempchars[v % num_chars]; + v /= num_chars; + } + + if (mkdir(path, S_IRWXU) == 0) { + retval = 0; + break; + } + else if (errno != EEXIST) + break; + } while (--tries); + + saved_errno = errno; + uv__close(fd); + if (tries == 0) { + errno = EEXIST; + return NULL; + } + + if (retval == -1) { + errno = saved_errno; + return NULL; + } + + return path; +} diff --git a/Utilities/cmlibuv/src/unix/os390-syscalls.h b/Utilities/cmlibuv/src/unix/os390-syscalls.h new file mode 100644 index 0000000..61a7cee --- /dev/null +++ b/Utilities/cmlibuv/src/unix/os390-syscalls.h @@ -0,0 +1,69 @@ +/* Copyright libuv project contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + + +#ifndef UV_OS390_SYSCALL_H_ +#define UV_OS390_SYSCALL_H_ + +#include "uv.h" +#include "internal.h" +#include <dirent.h> +#include <poll.h> +#include <pthread.h> + +#define EPOLL_CTL_ADD 1 +#define EPOLL_CTL_DEL 2 +#define EPOLL_CTL_MOD 3 +#define MAX_EPOLL_INSTANCES 256 +#define MAX_ITEMS_PER_EPOLL 1024 + +#define UV__O_CLOEXEC 0x80000 +#define UV__EPOLL_CLOEXEC UV__O_CLOEXEC +#define UV__EPOLL_CTL_ADD EPOLL_CTL_ADD +#define UV__EPOLL_CTL_DEL EPOLL_CTL_DEL +#define UV__EPOLL_CTL_MOD EPOLL_CTL_MOD + +struct epoll_event { + int events; + int fd; +}; + +typedef struct { + QUEUE member; + struct pollfd* items; + unsigned long size; +} uv__os390_epoll; + +/* epoll api */ +uv__os390_epoll* epoll_create1(int flags); +int epoll_ctl(uv__os390_epoll* ep, int op, int fd, struct epoll_event *event); +int epoll_wait(uv__os390_epoll* ep, struct epoll_event *events, int maxevents, int timeout); +int epoll_file_close(int fd); + +/* utility functions */ +int nanosleep(const struct timespec* req, struct timespec* rem); +int scandir(const char* maindir, struct dirent*** namelist, + int (*filter)(const struct dirent *), + int (*compar)(const struct dirent **, + const struct dirent **)); +char *mkdtemp(char* path); + +#endif /* UV_OS390_SYSCALL_H_ */ diff --git a/Utilities/cmlibuv/src/unix/os390.c b/Utilities/cmlibuv/src/unix/os390.c index bcdbc4b..be325a9 100644 --- a/Utilities/cmlibuv/src/unix/os390.c +++ b/Utilities/cmlibuv/src/unix/os390.c @@ -20,6 +20,628 @@ */ #include "internal.h" +#include <sys/ioctl.h> +#include <net/if.h> +#include <utmpx.h> +#include <unistd.h> +#include <sys/ps.h> +#if defined(__clang__) +#include "csrsic.h" +#else +#include "//'SYS1.SAMPLIB(CSRSIC)'" +#endif + +#define CVT_PTR 0x10 +#define CSD_OFFSET 0x294 + +/* + Long-term average CPU service used by this logical partition, + in millions of service units per hour. If this value is above + the partition's defined capacity, the partition will be capped. + It is calculated using the physical CPU adjustment factor + (RCTPCPUA) so it may not match other measures of service which + are based on the logical CPU adjustment factor. It is available + if the hardware supports LPAR cluster. +*/ +#define RCTLACS_OFFSET 0xC4 + +/* 32-bit count of alive CPUs. This includes both CPs and IFAs */ +#define CSD_NUMBER_ONLINE_CPUS 0xD4 + +/* Address of system resources manager (SRM) control table */ +#define CVTOPCTP_OFFSET 0x25C + +/* Address of the RCT table */ +#define RMCTRCT_OFFSET 0xE4 + +/* Address of the rsm control and enumeration area. */ +#define CVTRCEP_OFFSET 0x490 + +/* + Number of frames currently available to system. + Excluded are frames backing perm storage, frames offline, and bad frames. +*/ +#define RCEPOOL_OFFSET 0x004 + +/* Total number of frames currently on all available frame queues. */ +#define RCEAFC_OFFSET 0x088 + +/* CPC model length from the CSRSI Service. */ +#define CPCMODEL_LENGTH 16 + +/* Thread Entry constants */ +#define PGTH_CURRENT 1 +#define PGTH_LEN 26 +#define PGTHAPATH 0x20 +#pragma linkage(BPX4GTH, OS) +#pragma linkage(BPX1GTH, OS) + +typedef unsigned data_area_ptr_assign_type; + +typedef union { + struct { +#if defined(_LP64) + data_area_ptr_assign_type lower; +#endif + data_area_ptr_assign_type assign; + }; + char* deref; +} data_area_ptr; + + +void uv_loadavg(double avg[3]) { + /* TODO: implement the following */ + avg[0] = 0; + avg[1] = 0; + avg[2] = 0; +} + + +int uv__platform_loop_init(uv_loop_t* loop) { + uv__os390_epoll* ep; + + ep = epoll_create1(UV__EPOLL_CLOEXEC); + loop->ep = ep; + if (ep == NULL) + return -errno; + + return 0; +} + + +void uv__platform_loop_delete(uv_loop_t* loop) { + if (loop->ep != NULL) { + epoll_queue_close(loop->ep); + loop->ep = NULL; + } +} + + +uint64_t uv__hrtime(uv_clocktype_t type) { + struct timeval time; + gettimeofday(&time, NULL); + return (uint64_t) time.tv_sec * 1e9 + time.tv_usec * 1e3; +} + + +/* + Get the exe path using the thread entry information + in the address space. +*/ +static int getexe(const int pid, char* buf, size_t len) { + struct { + int pid; + int thid[2]; + char accesspid; + char accessthid; + char asid[2]; + char loginname[8]; + char flag; + char len; + } Input_data; + + union { + struct { + char gthb[4]; + int pid; + int thid[2]; + char accesspid; + char accessthid[3]; + int lenused; + int offsetProcess; + int offsetConTTY; + int offsetPath; + int offsetCommand; + int offsetFileData; + int offsetThread; + } Output_data; + char buf[2048]; + } Output_buf; + + struct Output_path_type { + char gthe[4]; + short int len; + char path[1024]; + }; + + int Input_length; + int Output_length; + void* Input_address; + void* Output_address; + struct Output_path_type* Output_path; + int rv; + int rc; + int rsn; + + Input_length = PGTH_LEN; + Output_length = sizeof(Output_buf); + Output_address = &Output_buf; + Input_address = &Input_data; + memset(&Input_data, 0, sizeof Input_data); + Input_data.flag |= PGTHAPATH; + Input_data.pid = pid; + Input_data.accesspid = PGTH_CURRENT; + +#ifdef _LP64 + BPX4GTH(&Input_length, + &Input_address, + &Output_length, + &Output_address, + &rv, + &rc, + &rsn); +#else + BPX1GTH(&Input_length, + &Input_address, + &Output_length, + &Output_address, + &rv, + &rc, + &rsn); +#endif + + if (rv == -1) { + errno = rc; + return -1; + } + + /* Check highest byte to ensure data availability */ + assert(((Output_buf.Output_data.offsetPath >>24) & 0xFF) == 'A'); + + /* Get the offset from the lowest 3 bytes */ + Output_path = (char*)(&Output_buf) + + (Output_buf.Output_data.offsetPath & 0x00FFFFFF); + + if (Output_path->len >= len) { + errno = ENOBUFS; + return -1; + } + + strncpy(buf, Output_path->path, len); + + return 0; +} + + +/* + * We could use a static buffer for the path manipulations that we need outside + * of the function, but this function could be called by multiple consumers and + * we don't want to potentially create a race condition in the use of snprintf. + * There is no direct way of getting the exe path in zOS - either through /procfs + * or through some libc APIs. The below approach is to parse the argv[0]'s pattern + * and use it in conjunction with PATH environment variable to craft one. + */ +int uv_exepath(char* buffer, size_t* size) { + int res; + char args[PATH_MAX]; + char abspath[PATH_MAX]; + size_t abspath_size; + int pid; + + if (buffer == NULL || size == NULL || *size == 0) + return -EINVAL; + + pid = getpid(); + res = getexe(pid, args, sizeof(args)); + if (res < 0) + return -EINVAL; + + /* + * Possibilities for args: + * i) an absolute path such as: /home/user/myprojects/nodejs/node + * ii) a relative path such as: ./node or ../myprojects/nodejs/node + * iii) a bare filename such as "node", after exporting PATH variable + * to its location. + */ + + /* Case i) and ii) absolute or relative paths */ + if (strchr(args, '/') != NULL) { + if (realpath(args, abspath) != abspath) + return -errno; + + abspath_size = strlen(abspath); + + *size -= 1; + if (*size > abspath_size) + *size = abspath_size; + + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; + + return 0; + } else { + /* Case iii). Search PATH environment variable */ + char trypath[PATH_MAX]; + char* clonedpath = NULL; + char* token = NULL; + char* path = getenv("PATH"); + + if (path == NULL) + return -EINVAL; + + clonedpath = uv__strdup(path); + if (clonedpath == NULL) + return -ENOMEM; + + token = strtok(clonedpath, ":"); + while (token != NULL) { + snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args); + if (realpath(trypath, abspath) == abspath) { + /* Check the match is executable */ + if (access(abspath, X_OK) == 0) { + abspath_size = strlen(abspath); + + *size -= 1; + if (*size > abspath_size) + *size = abspath_size; + + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; + + uv__free(clonedpath); + return 0; + } + } + token = strtok(NULL, ":"); + } + uv__free(clonedpath); + + /* Out of tokens (path entries), and no match found */ + return -EINVAL; + } +} + + +uint64_t uv_get_free_memory(void) { + uint64_t freeram; + + data_area_ptr cvt = {0}; + data_area_ptr rcep = {0}; + cvt.assign = *(data_area_ptr_assign_type*)(CVT_PTR); + rcep.assign = *(data_area_ptr_assign_type*)(cvt.deref + CVTRCEP_OFFSET); + freeram = *((uint64_t*)(rcep.deref + RCEAFC_OFFSET)) * 4; + return freeram; +} + + +uint64_t uv_get_total_memory(void) { + uint64_t totalram; + + data_area_ptr cvt = {0}; + data_area_ptr rcep = {0}; + cvt.assign = *(data_area_ptr_assign_type*)(CVT_PTR); + rcep.assign = *(data_area_ptr_assign_type*)(cvt.deref + CVTRCEP_OFFSET); + totalram = *((uint64_t*)(rcep.deref + RCEPOOL_OFFSET)) * 4; + return totalram; +} + + +int uv_resident_set_memory(size_t* rss) { + W_PSPROC buf; + + memset(&buf, 0, sizeof(buf)); + if (w_getpsent(0, &buf, sizeof(W_PSPROC)) == -1) + return -EINVAL; + + *rss = buf.ps_size; + return 0; +} + + +int uv_uptime(double* uptime) { + struct utmpx u ; + struct utmpx *v; + time64_t t; + + u.ut_type = BOOT_TIME; + v = getutxid(&u); + if (v == NULL) + return -1; + *uptime = difftime64(time64(&t), v->ut_tv.tv_sec); + return 0; +} + + +int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { + uv_cpu_info_t* cpu_info; + int result; + int idx; + siv1v2 info; + data_area_ptr cvt = {0}; + data_area_ptr csd = {0}; + data_area_ptr rmctrct = {0}; + data_area_ptr cvtopctp = {0}; + int cpu_usage_avg; + + cvt.assign = *(data_area_ptr_assign_type*)(CVT_PTR); + + csd.assign = *((data_area_ptr_assign_type *) (cvt.deref + CSD_OFFSET)); + cvtopctp.assign = *((data_area_ptr_assign_type *) (cvt.deref + CVTOPCTP_OFFSET)); + rmctrct.assign = *((data_area_ptr_assign_type *) (cvtopctp.deref + RMCTRCT_OFFSET)); + + *count = *((int*) (csd.deref + CSD_NUMBER_ONLINE_CPUS)); + cpu_usage_avg = *((unsigned short int*) (rmctrct.deref + RCTLACS_OFFSET)); + + *cpu_infos = uv__malloc(*count * sizeof(uv_cpu_info_t)); + if (!*cpu_infos) + return -ENOMEM; + + cpu_info = *cpu_infos; + idx = 0; + while (idx < *count) { + cpu_info->speed = *(int*)(info.siv1v2si22v1.si22v1cpucapability); + cpu_info->model = uv__malloc(CPCMODEL_LENGTH + 1); + memset(cpu_info->model, '\0', CPCMODEL_LENGTH + 1); + memcpy(cpu_info->model, info.siv1v2si11v1.si11v1cpcmodel, CPCMODEL_LENGTH); + cpu_info->cpu_times.user = cpu_usage_avg; + /* TODO: implement the following */ + cpu_info->cpu_times.sys = 0; + cpu_info->cpu_times.idle = 0; + cpu_info->cpu_times.irq = 0; + cpu_info->cpu_times.nice = 0; + ++cpu_info; + ++idx; + } + + return 0; +} + + +void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { + for (int i = 0; i < count; ++i) + uv__free(cpu_infos[i].model); + uv__free(cpu_infos); +} + + +static int uv__interface_addresses_v6(uv_interface_address_t** addresses, + int* count) { + uv_interface_address_t* address; + int sockfd; + int maxsize; + __net_ifconf6header_t ifc; + __net_ifconf6entry_t* ifr; + __net_ifconf6entry_t* p; + __net_ifconf6entry_t flg; + + *count = 0; + /* Assume maximum buffer size allowable */ + maxsize = 16384; + + if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) + return -errno; + + ifc.__nif6h_version = 1; + ifc.__nif6h_buflen = maxsize; + ifc.__nif6h_buffer = uv__calloc(1, maxsize);; + + if (ioctl(sockfd, SIOCGIFCONF6, &ifc) == -1) { + uv__close(sockfd); + return -errno; + } + + + *count = 0; + ifr = (__net_ifconf6entry_t*)(ifc.__nif6h_buffer); + while ((char*)ifr < (char*)ifc.__nif6h_buffer + ifc.__nif6h_buflen) { + p = ifr; + ifr = (__net_ifconf6entry_t*)((char*)ifr + ifc.__nif6h_entrylen); + + if (!(p->__nif6e_addr.sin6_family == AF_INET6 || + p->__nif6e_addr.sin6_family == AF_INET)) + continue; + + if (!(p->__nif6e_flags & _NIF6E_FLAGS_ON_LINK_ACTIVE)) + continue; + + ++(*count); + } + + /* Alloc the return interface structs */ + *addresses = uv__malloc(*count * sizeof(uv_interface_address_t)); + if (!(*addresses)) { + uv__close(sockfd); + return -ENOMEM; + } + address = *addresses; + + ifr = (__net_ifconf6entry_t*)(ifc.__nif6h_buffer); + while ((char*)ifr < (char*)ifc.__nif6h_buffer + ifc.__nif6h_buflen) { + p = ifr; + ifr = (__net_ifconf6entry_t*)((char*)ifr + ifc.__nif6h_entrylen); + + if (!(p->__nif6e_addr.sin6_family == AF_INET6 || + p->__nif6e_addr.sin6_family == AF_INET)) + continue; + + if (!(p->__nif6e_flags & _NIF6E_FLAGS_ON_LINK_ACTIVE)) + continue; + + /* All conditions above must match count loop */ + + address->name = uv__strdup(p->__nif6e_name); + + if (p->__nif6e_addr.sin6_family == AF_INET6) + address->address.address6 = *((struct sockaddr_in6*) &p->__nif6e_addr); + else + address->address.address4 = *((struct sockaddr_in*) &p->__nif6e_addr); + + /* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */ + + address->is_internal = flg.__nif6e_flags & _NIF6E_FLAGS_LOOPBACK ? 1 : 0; + + address++; + } + + uv__close(sockfd); + return 0; +} + + +int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { + uv_interface_address_t* address; + int sockfd; + int maxsize; + struct ifconf ifc; + struct ifreq flg; + struct ifreq* ifr; + struct ifreq* p; + int count_v6; + + /* get the ipv6 addresses first */ + uv_interface_address_t* addresses_v6; + uv__interface_addresses_v6(&addresses_v6, &count_v6); + + /* now get the ipv4 addresses */ + *count = 0; + + /* Assume maximum buffer size allowable */ + maxsize = 16384; + + sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (0 > sockfd) + return -errno; + + ifc.ifc_req = uv__calloc(1, maxsize); + ifc.ifc_len = maxsize; + if (ioctl(sockfd, SIOCGIFCONF, &ifc) == -1) { + uv__close(sockfd); + return -errno; + } + +#define MAX(a,b) (((a)>(b))?(a):(b)) +#define ADDR_SIZE(p) MAX((p).sa_len, sizeof(p)) + + /* Count all up and running ipv4/ipv6 addresses */ + ifr = ifc.ifc_req; + while ((char*)ifr < (char*)ifc.ifc_req + ifc.ifc_len) { + p = ifr; + ifr = (struct ifreq*) + ((char*)ifr + sizeof(ifr->ifr_name) + ADDR_SIZE(ifr->ifr_addr)); + + if (!(p->ifr_addr.sa_family == AF_INET6 || + p->ifr_addr.sa_family == AF_INET)) + continue; + + memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name)); + if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) { + uv__close(sockfd); + return -errno; + } + + if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING)) + continue; + + (*count)++; + } + + /* Alloc the return interface structs */ + *addresses = uv__malloc((*count + count_v6) * + sizeof(uv_interface_address_t)); + + if (!(*addresses)) { + uv__close(sockfd); + return -ENOMEM; + } + address = *addresses; + + /* copy over the ipv6 addresses */ + memcpy(address, addresses_v6, count_v6 * sizeof(uv_interface_address_t)); + address += count_v6; + *count += count_v6; + uv__free(addresses_v6); + + ifr = ifc.ifc_req; + while ((char*)ifr < (char*)ifc.ifc_req + ifc.ifc_len) { + p = ifr; + ifr = (struct ifreq*) + ((char*)ifr + sizeof(ifr->ifr_name) + ADDR_SIZE(ifr->ifr_addr)); + + if (!(p->ifr_addr.sa_family == AF_INET6 || + p->ifr_addr.sa_family == AF_INET)) + continue; + + memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name)); + if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) { + uv__close(sockfd); + return -ENOSYS; + } + + if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING)) + continue; + + /* All conditions above must match count loop */ + + address->name = uv__strdup(p->ifr_name); + + if (p->ifr_addr.sa_family == AF_INET6) { + address->address.address6 = *((struct sockaddr_in6*) &p->ifr_addr); + } else { + address->address.address4 = *((struct sockaddr_in*) &p->ifr_addr); + } + + address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0; + address++; + } + +#undef ADDR_SIZE +#undef MAX + + uv__close(sockfd); + return 0; +} + + +void uv_free_interface_addresses(uv_interface_address_t* addresses, + int count) { + int i; + for (i = 0; i < count; ++i) + uv__free(addresses[i].name); + uv__free(addresses); +} + + +void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) { + struct epoll_event* events; + struct epoll_event dummy; + uintptr_t i; + uintptr_t nfds; + + assert(loop->watchers != NULL); + + events = (struct epoll_event*) loop->watchers[loop->nwatchers]; + nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1]; + if (events != NULL) + /* Invalidate events with same file descriptor */ + for (i = 0; i < nfds; i++) + if ((int) events[i].fd == fd) + events[i].fd = -1; + + /* Remove the file descriptor from the epoll. */ + if (loop->ep != NULL) + epoll_ctl(loop->ep, UV__EPOLL_CTL_DEL, fd, &dummy); +} + int uv__io_check_fd(uv_loop_t* loop, int fd) { struct pollfd p[1]; @@ -40,3 +662,204 @@ int uv__io_check_fd(uv_loop_t* loop, int fd) { return 0; } + + +void uv__fs_event_close(uv_fs_event_t* handle) { + UNREACHABLE(); +} + + +int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) { + return -ENOSYS; +} + + +int uv_fs_event_start(uv_fs_event_t* handle, uv_fs_event_cb cb, + const char* filename, unsigned int flags) { + return -ENOSYS; +} + + +int uv_fs_event_stop(uv_fs_event_t* handle) { + return -ENOSYS; +} + + +void uv__io_poll(uv_loop_t* loop, int timeout) { + static const int max_safe_timeout = 1789569; + struct epoll_event events[1024]; + struct epoll_event* pe; + struct epoll_event e; + int real_timeout; + QUEUE* q; + uv__io_t* w; + uint64_t base; + int count; + int nfds; + int fd; + int op; + int i; + + if (loop->nfds == 0) { + assert(QUEUE_EMPTY(&loop->watcher_queue)); + return; + } + + while (!QUEUE_EMPTY(&loop->watcher_queue)) { + uv_stream_t* stream; + + q = QUEUE_HEAD(&loop->watcher_queue); + QUEUE_REMOVE(q); + QUEUE_INIT(q); + w = QUEUE_DATA(q, uv__io_t, watcher_queue); + + assert(w->pevents != 0); + assert(w->fd >= 0); + + stream= container_of(w, uv_stream_t, io_watcher); + + assert(w->fd < (int) loop->nwatchers); + + e.events = w->pevents; + e.fd = w->fd; + + if (w->events == 0) + op = UV__EPOLL_CTL_ADD; + else + op = UV__EPOLL_CTL_MOD; + + /* XXX Future optimization: do EPOLL_CTL_MOD lazily if we stop watching + * events, skip the syscall and squelch the events after epoll_wait(). + */ + if (epoll_ctl(loop->ep, op, w->fd, &e)) { + if (errno != EEXIST) + abort(); + + assert(op == UV__EPOLL_CTL_ADD); + + /* We've reactivated a file descriptor that's been watched before. */ + if (epoll_ctl(loop->ep, UV__EPOLL_CTL_MOD, w->fd, &e)) + abort(); + } + + w->events = w->pevents; + } + + assert(timeout >= -1); + base = loop->time; + count = 48; /* Benchmarks suggest this gives the best throughput. */ + real_timeout = timeout; + int nevents = 0; + + nfds = 0; + for (;;) { + if (sizeof(int32_t) == sizeof(long) && timeout >= max_safe_timeout) + timeout = max_safe_timeout; + + nfds = epoll_wait(loop->ep, events, + ARRAY_SIZE(events), timeout); + + /* Update loop->time unconditionally. It's tempting to skip the update when + * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the + * operating system didn't reschedule our process while in the syscall. + */ + base = loop->time; + SAVE_ERRNO(uv__update_time(loop)); + if (nfds == 0) { + assert(timeout != -1); + timeout = real_timeout - timeout; + if (timeout > 0) + continue; + + return; + } + + if (nfds == -1) { + + if (errno != EINTR) + abort(); + + if (timeout == -1) + continue; + + if (timeout == 0) + return; + + /* Interrupted by a signal. Update timeout and poll again. */ + goto update_timeout; + } + + + assert(loop->watchers != NULL); + loop->watchers[loop->nwatchers] = (void*) events; + loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds; + for (i = 0; i < nfds; i++) { + pe = events + i; + fd = pe->fd; + + /* Skip invalidated events, see uv__platform_invalidate_fd */ + if (fd == -1) + continue; + + assert(fd >= 0); + assert((unsigned) fd < loop->nwatchers); + + w = loop->watchers[fd]; + + if (w == NULL) { + /* File descriptor that we've stopped watching, disarm it. + * + * Ignore all errors because we may be racing with another thread + * when the file descriptor is closed. + */ + epoll_ctl(loop->ep, UV__EPOLL_CTL_DEL, fd, pe); + continue; + } + + /* Give users only events they're interested in. Prevents spurious + * callbacks when previous callback invocation in this loop has stopped + * the current watcher. Also, filters out events that users has not + * requested us to watch. + */ + pe->events &= w->pevents | POLLERR | POLLHUP; + + if (pe->events == POLLERR || pe->events == POLLHUP) + pe->events |= w->pevents & (POLLIN | POLLOUT); + + if (pe->events != 0) { + w->cb(loop, w, pe->events); + nevents++; + } + } + loop->watchers[loop->nwatchers] = NULL; + loop->watchers[loop->nwatchers + 1] = NULL; + + if (nevents != 0) { + if (nfds == ARRAY_SIZE(events) && --count != 0) { + /* Poll for more events but don't block this time. */ + timeout = 0; + continue; + } + return; + } + + if (timeout == 0) + return; + + if (timeout == -1) + continue; + +update_timeout: + assert(timeout > 0); + + real_timeout -= (loop->time - base); + if (real_timeout <= 0) + return; + + timeout = real_timeout; + } +} + +void uv__set_process_title(const char* title) { + /* do nothing */ +} diff --git a/Utilities/cmlibuv/src/unix/poll.c b/Utilities/cmlibuv/src/unix/poll.c index 4c0d478..370994b 100644 --- a/Utilities/cmlibuv/src/unix/poll.c +++ b/Utilities/cmlibuv/src/unix/poll.c @@ -92,7 +92,7 @@ static void uv__poll_stop(uv_poll_t* handle) { int uv_poll_stop(uv_poll_t* handle) { - assert(!(handle->flags & (UV_CLOSING | UV_CLOSED))); + assert(!uv__is_closing(handle)); uv__poll_stop(handle); return 0; } @@ -102,7 +102,7 @@ int uv_poll_start(uv_poll_t* handle, int pevents, uv_poll_cb poll_cb) { int events; assert((pevents & ~(UV_READABLE | UV_WRITABLE | UV_DISCONNECT)) == 0); - assert(!(handle->flags & (UV_CLOSING | UV_CLOSED))); + assert(!uv__is_closing(handle)); uv__poll_stop(handle); diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c index 45f5b45..f2fe305 100644 --- a/Utilities/cmlibuv/src/unix/process.c +++ b/Utilities/cmlibuv/src/unix/process.c @@ -323,7 +323,7 @@ static void uv__process_child_init(const uv_process_options_t* options, } if (fd == use_fd) - uv__cloexec(use_fd, 0); + uv__cloexec_fcntl(use_fd, 0); else fd = dup2(use_fd, fd); @@ -333,7 +333,7 @@ static void uv__process_child_init(const uv_process_options_t* options, } if (fd <= 2) - uv__nonblock(fd, 0); + uv__nonblock_fcntl(fd, 0); if (close_fd >= stdio_count) uv__close(close_fd); diff --git a/Utilities/cmlibuv/src/unix/proctitle.c b/Utilities/cmlibuv/src/unix/proctitle.c index 08d875f..9160f7e 100644 --- a/Utilities/cmlibuv/src/unix/proctitle.c +++ b/Utilities/cmlibuv/src/unix/proctitle.c @@ -48,9 +48,15 @@ char** uv_setup_args(int argc, char** argv) { for (i = 0; i < argc; i++) size += strlen(argv[i]) + 1; +#if defined(__MVS__) + /* argv is not adjacent. So just use argv[0] */ + process_title.str = argv[0]; + process_title.len = strlen(argv[0]); +#else process_title.str = argv[0]; process_title.len = argv[argc - 1] + strlen(argv[argc - 1]) - argv[0]; assert(process_title.len + 1 == size); /* argv memory should be adjacent. */ +#endif /* Add space for the argv pointers. */ size += (argc + 1) * sizeof(char*); diff --git a/Utilities/cmlibuv/src/unix/pthread-barrier.c b/Utilities/cmlibuv/src/unix/pthread-barrier.c index f57bf25..b6e604d 100644 --- a/Utilities/cmlibuv/src/unix/pthread-barrier.c +++ b/Utilities/cmlibuv/src/unix/pthread-barrier.c @@ -73,7 +73,8 @@ int pthread_barrier_wait(pthread_barrier_t* barrier) { if (++b->in == b->threshold) { b->in = 0; b->out = b->threshold - 1; - assert(pthread_cond_signal(&b->cond) == 0); + rc = pthread_cond_signal(&b->cond); + assert(rc == 0); pthread_mutex_unlock(&b->mutex); return PTHREAD_BARRIER_SERIAL_THREAD; diff --git a/Utilities/cmlibuv/src/unix/signal.c b/Utilities/cmlibuv/src/unix/signal.c index d82b9b7..dbd8f86 100644 --- a/Utilities/cmlibuv/src/unix/signal.c +++ b/Utilities/cmlibuv/src/unix/signal.c @@ -43,7 +43,7 @@ static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2); static void uv__signal_stop(uv_signal_t* handle); -static pthread_once_t uv__signal_global_init_guard = PTHREAD_ONCE_INIT; +static uv_once_t uv__signal_global_init_guard = UV_ONCE_INIT; static struct uv__signal_tree_s uv__signal_tree = RB_INITIALIZER(uv__signal_tree); static int uv__signal_lock_pipefd[2]; @@ -64,7 +64,7 @@ static void uv__signal_global_init(void) { void uv__signal_global_once_init(void) { - pthread_once(&uv__signal_global_init_guard, uv__signal_global_init); + uv_once(&uv__signal_global_init_guard, uv__signal_global_init); } @@ -290,7 +290,7 @@ int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) { sigset_t saved_sigmask; int err; - assert(!(handle->flags & (UV_CLOSING | UV_CLOSED))); + assert(!uv__is_closing(handle)); /* If the user supplies signum == 0, then return an error already. If the * signum is otherwise invalid then uv__signal_register will find out @@ -434,7 +434,7 @@ static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2) { int uv_signal_stop(uv_signal_t* handle) { - assert(!(handle->flags & (UV_CLOSING | UV_CLOSED))); + assert(!uv__is_closing(handle)); uv__signal_stop(handle); return 0; } diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c index d20d0bc..7059df1 100644 --- a/Utilities/cmlibuv/src/unix/stream.c +++ b/Utilities/cmlibuv/src/unix/stream.c @@ -390,7 +390,7 @@ failed_malloc: int uv__stream_open(uv_stream_t* stream, int fd, int flags) { -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__MVS__) int enable; #endif @@ -409,7 +409,7 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { return -errno; } -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__MVS__) enable = 1; if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) && errno != ENOTSOCK && @@ -1194,6 +1194,30 @@ static void uv__read(uv_stream_t* stream) { return; } } + +#if defined(__MVS__) + if (is_ipc && msg.msg_controllen > 0) { + uv_buf_t blankbuf; + int nread; + struct iovec *old; + + blankbuf.base = 0; + blankbuf.len = 0; + old = msg.msg_iov; + msg.msg_iov = (struct iovec*) &blankbuf; + nread = 0; + do { + nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0); + err = uv__stream_recv_cmsg(stream, &msg); + if (err != 0) { + stream->read_cb(stream, err, &buf); + msg.msg_iov = old; + return; + } + } while (nread == 0 && msg.msg_controllen > 0); + msg.msg_iov = old; + } +#endif stream->read_cb(stream, nread, &buf); /* Return if we didn't fill the buffer, there is no more data to read. */ @@ -1221,8 +1245,7 @@ int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) { if (!(stream->flags & UV_STREAM_WRITABLE) || stream->flags & UV_STREAM_SHUT || stream->flags & UV_STREAM_SHUTTING || - stream->flags & UV_CLOSED || - stream->flags & UV_CLOSING) { + uv__is_closing(stream)) { return -ENOTCONN; } diff --git a/Utilities/cmlibuv/src/unix/sunos.c b/Utilities/cmlibuv/src/unix/sunos.c index 3e7a759..a43f7f1 100644 --- a/Utilities/cmlibuv/src/unix/sunos.c +++ b/Utilities/cmlibuv/src/unix/sunos.c @@ -695,6 +695,11 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { uv__free(cpu_infos); } +#ifdef SUNOS_NO_IFADDRS +int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { + return -ENOSYS; +} +#else /* SUNOS_NO_IFADDRS */ /* * Inspired By: * https://blogs.oracle.com/paulie/entry/retrieving_mac_address_in_solaris @@ -742,9 +747,6 @@ static int uv__set_phys_addr(uv_interface_address_t* address, } int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { -#ifdef SUNOS_NO_IFADDRS - return -ENOSYS; -#else uv_interface_address_t* address; struct ifaddrs* addrs; struct ifaddrs* ent; @@ -805,9 +807,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { freeifaddrs(addrs); return 0; -#endif /* SUNOS_NO_IFADDRS */ } - +#endif /* SUNOS_NO_IFADDRS */ void uv_free_interface_addresses(uv_interface_address_t* addresses, int count) { diff --git a/Utilities/cmlibuv/src/unix/thread.c b/Utilities/cmlibuv/src/unix/thread.c index 52989f7..a9b5e4c 100644 --- a/Utilities/cmlibuv/src/unix/thread.c +++ b/Utilities/cmlibuv/src/unix/thread.c @@ -40,28 +40,8 @@ #undef NANOSEC #define NANOSEC ((uint64_t) 1e9) -struct thread_ctx { - void (*entry)(void* arg); - void* arg; -}; - - -static void* uv__thread_start(void *arg) -{ - struct thread_ctx *ctx_p; - struct thread_ctx ctx; - - ctx_p = arg; - ctx = *ctx_p; - uv__free(ctx_p); - ctx.entry(ctx.arg); - - return 0; -} - int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { - struct thread_ctx* ctx; int err; pthread_attr_t* attr; #if defined(__APPLE__) @@ -69,13 +49,6 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { struct rlimit lim; #endif - ctx = uv__malloc(sizeof(*ctx)); - if (ctx == NULL) - return UV_ENOMEM; - - ctx->entry = entry; - ctx->arg = arg; - /* On OSX threads other than the main thread are created with a reduced stack * size by default, adjust it to RLIMIT_STACK. */ @@ -99,14 +72,11 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { attr = NULL; #endif - err = pthread_create(tid, attr, uv__thread_start, ctx); + err = pthread_create(tid, attr, (void*(*)(void*)) entry, arg); if (attr != NULL) pthread_attr_destroy(attr); - if (err) - uv__free(ctx); - return -err; } diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c index 46d9546..bc7d137 100644 --- a/Utilities/cmlibuv/src/uv-common.c +++ b/Utilities/cmlibuv/src/uv-common.c @@ -512,8 +512,18 @@ void uv__fs_scandir_cleanup(uv_fs_t* req) { int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) { uv__dirent_t** dents; uv__dirent_t* dent; + unsigned int* nbufs; - unsigned int* nbufs = uv__get_nbufs(req); + /* Check to see if req passed */ + if (req->result < 0) + return req->result; + + /* Ptr will be null if req was canceled or no files found */ + if (!req->ptr) + return UV_EOF; + + nbufs = uv__get_nbufs(req); + assert(nbufs); dents = req->ptr; diff --git a/Utilities/cmlibuv/src/win/core.c b/Utilities/cmlibuv/src/win/core.c index 9d00afc..e84186d 100644 --- a/Utilities/cmlibuv/src/win/core.c +++ b/Utilities/cmlibuv/src/win/core.c @@ -35,10 +35,6 @@ #include "handle-inl.h" #include "req-inl.h" - -static uv_loop_t default_loop_struct; -static uv_loop_t* default_loop_ptr; - /* uv_once initialization guards */ static uv_once_t uv_init_guard_ = UV_ONCE_INIT; diff --git a/Utilities/cmlibuv/src/win/error.c b/Utilities/cmlibuv/src/win/error.c index c512f35..642d111 100644 --- a/Utilities/cmlibuv/src/win/error.c +++ b/Utilities/cmlibuv/src/win/error.c @@ -71,6 +71,7 @@ int uv_translate_sys_error(int sys_errno) { switch (sys_errno) { case ERROR_NOACCESS: return UV_EACCES; case WSAEACCES: return UV_EACCES; + case ERROR_ELEVATION_REQUIRED: return UV_EACCES; case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE; case WSAEADDRINUSE: return UV_EADDRINUSE; case WSAEADDRNOTAVAIL: return UV_EADDRNOTAVAIL; diff --git a/Utilities/cmlibuv/src/win/fs-event.c b/Utilities/cmlibuv/src/win/fs-event.c index 03e4adc..05fc1d0 100644 --- a/Utilities/cmlibuv/src/win/fs-event.c +++ b/Utilities/cmlibuv/src/win/fs-event.c @@ -188,7 +188,6 @@ int uv_fs_event_start(uv_fs_event_t* handle, if (is_path_dir) { /* path is a directory, so that's the directory that we will watch. */ - handle->dirw = pathw; dir_to_watch = pathw; } else { /* @@ -274,6 +273,8 @@ int uv_fs_event_start(uv_fs_event_t* handle, goto error; } + assert(is_path_dir ? pathw != NULL : pathw == NULL); + handle->dirw = pathw; handle->req_pending = 1; return 0; diff --git a/Utilities/cmlibuv/src/win/fs.c b/Utilities/cmlibuv/src/win/fs.c index f1711ac..6902d4f 100644 --- a/Utilities/cmlibuv/src/win/fs.c +++ b/Utilities/cmlibuv/src/win/fs.c @@ -123,7 +123,7 @@ INLINE static int fs__capture_path(uv_fs_t* req, const char* path, const char* new_path, const int copy_path) { char* buf; char* pos; - ssize_t buf_sz = 0, path_len, pathw_len = 0, new_pathw_len = 0; + ssize_t buf_sz = 0, path_len = 0, pathw_len = 0, new_pathw_len = 0; /* new_path can only be set if path is also set. */ assert(new_path == NULL || path != NULL); @@ -403,7 +403,6 @@ void fs__open(uv_fs_t* req) { switch (flags & (_O_RDONLY | _O_WRONLY | _O_RDWR)) { case _O_RDONLY: access = FILE_GENERIC_READ; - attributes |= FILE_FLAG_BACKUP_SEMANTICS; break; case _O_WRONLY: access = FILE_GENERIC_WRITE; @@ -418,7 +417,6 @@ void fs__open(uv_fs_t* req) { if (flags & _O_APPEND) { access &= ~FILE_WRITE_DATA; access |= FILE_APPEND_DATA; - attributes &= ~FILE_FLAG_BACKUP_SEMANTICS; } /* diff --git a/Utilities/cmlibuv/src/win/getaddrinfo.c b/Utilities/cmlibuv/src/win/getaddrinfo.c index 744f8e0..c13bfec 100644 --- a/Utilities/cmlibuv/src/win/getaddrinfo.c +++ b/Utilities/cmlibuv/src/win/getaddrinfo.c @@ -262,8 +262,7 @@ int uv_getaddrinfo(uv_loop_t* loop, int err; if (req == NULL || (node == NULL && service == NULL)) { - err = WSAEINVAL; - goto error; + return UV_EINVAL; } uv_req_init(loop, (uv_req_t*)req); diff --git a/Utilities/cmlibuv/src/win/process-stdio.c b/Utilities/cmlibuv/src/win/process-stdio.c index e3c06f5..032e309 100644 --- a/Utilities/cmlibuv/src/win/process-stdio.c +++ b/Utilities/cmlibuv/src/win/process-stdio.c @@ -372,6 +372,7 @@ int uv__stdio_create(uv_loop_t* loop, case FILE_TYPE_PIPE: CHILD_STDIO_CRT_FLAGS(buffer, i) = FOPEN | FPIPE; + break; case FILE_TYPE_CHAR: case FILE_TYPE_REMOTE: diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c index 855c374..bdf88d2 100644 --- a/Utilities/cmlibuv/src/win/process.c +++ b/Utilities/cmlibuv/src/win/process.c @@ -492,7 +492,7 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target) { * input : hello\\"world * output: "hello\\\\\"world" * input : hello world\ - * output: "hello world\" + * output: "hello world\\" */ *(target++) = L'"'; diff --git a/Utilities/cmlibuv/src/win/signal.c b/Utilities/cmlibuv/src/win/signal.c index 2c64a55..af7974c 100644 --- a/Utilities/cmlibuv/src/win/signal.c +++ b/Utilities/cmlibuv/src/win/signal.c @@ -30,12 +30,14 @@ RB_HEAD(uv_signal_tree_s, uv_signal_s); static struct uv_signal_tree_s uv__signal_tree = RB_INITIALIZER(uv__signal_tree); -static ssize_t volatile uv__signal_control_handler_refs = 0; static CRITICAL_SECTION uv__signal_lock; +static BOOL WINAPI uv__signal_control_handler(DWORD type); void uv_signals_init() { InitializeCriticalSection(&uv__signal_lock); + if (!SetConsoleCtrlHandler(uv__signal_control_handler, TRUE)) + abort(); } @@ -125,102 +127,6 @@ static BOOL WINAPI uv__signal_control_handler(DWORD type) { } -static int uv__signal_register_control_handler() { - /* When this function is called, the uv__signal_lock must be held. */ - - /* If the console control handler has already been hooked, just add a */ - /* reference. */ - if (uv__signal_control_handler_refs > 0) { - uv__signal_control_handler_refs++; - return 0; - } - - if (!SetConsoleCtrlHandler(uv__signal_control_handler, TRUE)) - return GetLastError(); - - uv__signal_control_handler_refs++; - - return 0; -} - - -static void uv__signal_unregister_control_handler() { - /* When this function is called, the uv__signal_lock must be held. */ - BOOL r; - - /* Don't unregister if the number of console control handlers exceeds one. */ - /* Just remove a reference in that case. */ - if (uv__signal_control_handler_refs > 1) { - uv__signal_control_handler_refs--; - return; - } - - assert(uv__signal_control_handler_refs == 1); - - r = SetConsoleCtrlHandler(uv__signal_control_handler, FALSE); - /* This should never fail; if it does it is probably a bug in libuv. */ - assert(r); - - uv__signal_control_handler_refs--; -} - - -static int uv__signal_register(int signum) { - switch (signum) { - case SIGINT: - case SIGBREAK: - case SIGHUP: - return uv__signal_register_control_handler(); - - case SIGWINCH: - /* SIGWINCH is generated in tty.c. No need to register anything. */ - return 0; - - case SIGILL: - case SIGABRT_COMPAT: - case SIGFPE: - case SIGSEGV: - case SIGTERM: - case SIGABRT: - /* Signal is never raised. */ - return 0; - - default: - /* Invalid signal. */ - return ERROR_INVALID_PARAMETER; - } -} - - -static void uv__signal_unregister(int signum) { - switch (signum) { - case SIGINT: - case SIGBREAK: - case SIGHUP: - uv__signal_unregister_control_handler(); - return; - - case SIGWINCH: - /* SIGWINCH is generated in tty.c. No need to unregister anything. */ - return; - - case SIGILL: - case SIGABRT_COMPAT: - case SIGFPE: - case SIGSEGV: - case SIGTERM: - case SIGABRT: - /* Nothing is registered for this signal. */ - return; - - default: - /* Libuv bug. */ - assert(0 && "Invalid signum"); - return; - } -} - - int uv_signal_init(uv_loop_t* loop, uv_signal_t* handle) { uv_req_t* req; @@ -247,8 +153,6 @@ int uv_signal_stop(uv_signal_t* handle) { EnterCriticalSection(&uv__signal_lock); - uv__signal_unregister(handle->signum); - removed_handle = RB_REMOVE(uv_signal_tree_s, &uv__signal_tree, handle); assert(removed_handle == handle); @@ -262,14 +166,9 @@ int uv_signal_stop(uv_signal_t* handle) { int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) { - int err; - - /* If the user supplies signum == 0, then return an error already. If the */ - /* signum is otherwise invalid then uv__signal_register will find out */ - /* eventually. */ - if (signum == 0) { + /* Test for invalid signal values. */ + if (signum != SIGWINCH && (signum <= 0 || signum >= NSIG)) return UV_EINVAL; - } /* Short circuit: if the signal watcher is already watching {signum} don't */ /* go through the process of deregistering and registering the handler. */ @@ -289,13 +188,6 @@ int uv_signal_start(uv_signal_t* handle, uv_signal_cb signal_cb, int signum) { EnterCriticalSection(&uv__signal_lock); - err = uv__signal_register(signum); - if (err) { - /* Uh-oh, didn't work. */ - LeaveCriticalSection(&uv__signal_lock); - return uv_translate_sys_error(err); - } - handle->signum = signum; RB_INSERT(uv_signal_tree_s, &uv__signal_tree, handle); diff --git a/Utilities/cmlibuv/src/win/tty.c b/Utilities/cmlibuv/src/win/tty.c index 18d68d0..1b7adf6 100644 --- a/Utilities/cmlibuv/src/win/tty.c +++ b/Utilities/cmlibuv/src/win/tty.c @@ -56,6 +56,7 @@ #define ANSI_BACKSLASH_SEEN 0x80 #define MAX_INPUT_BUFFER_LENGTH 8192 +#define MAX_CONSOLE_CHAR 8192 #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 @@ -1003,6 +1004,9 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb, if (handle->tty.rd.last_key_len > 0) { SET_REQ_SUCCESS(&handle->read_req); uv_insert_pending_req(handle->loop, (uv_req_t*) &handle->read_req); + /* Make sure no attempt is made to insert it again until it's handled. */ + handle->flags |= UV_HANDLE_READ_PENDING; + handle->reqs_pending++; return 0; } @@ -1616,17 +1620,29 @@ static int uv_tty_write_bufs(uv_tty_t* handle, DWORD* error) { /* We can only write 8k characters at a time. Windows can't handle */ /* much more characters in a single console write anyway. */ - WCHAR utf16_buf[8192]; + WCHAR utf16_buf[MAX_CONSOLE_CHAR]; + WCHAR* utf16_buffer; DWORD utf16_buf_used = 0; - unsigned int i; - -#define FLUSH_TEXT() \ - do { \ - if (utf16_buf_used > 0) { \ - uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); \ - utf16_buf_used = 0; \ - } \ - } while (0) + unsigned int i, len, max_len, pos; + int allocate = 0; + +#define FLUSH_TEXT() \ + do { \ + pos = 0; \ + do { \ + len = utf16_buf_used - pos; \ + if (len > MAX_CONSOLE_CHAR) \ + len = MAX_CONSOLE_CHAR; \ + uv_tty_emit_text(handle, &utf16_buffer[pos], len, error); \ + pos += len; \ + } while (pos < utf16_buf_used); \ + if (allocate) { \ + uv__free(utf16_buffer); \ + allocate = 0; \ + utf16_buffer = utf16_buf; \ + } \ + utf16_buf_used = 0; \ + } while (0) #define ENSURE_BUFFER_SPACE(wchars_needed) \ if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \ @@ -1644,38 +1660,47 @@ static int uv_tty_write_bufs(uv_tty_t* handle, /* state. */ *error = ERROR_SUCCESS; + utf16_buffer = utf16_buf; + uv_sem_wait(&uv_tty_output_lock); for (i = 0; i < nbufs; i++) { uv_buf_t buf = bufs[i]; unsigned int j; - if (uv__vterm_state == UV_SUPPORTED) { - utf16_buf_used = MultiByteToWideChar(CP_UTF8, - 0, - buf.base, - buf.len, - NULL, - 0); + if (uv__vterm_state == UV_SUPPORTED && buf.len > 0) { + utf16_buf_used = MultiByteToWideChar(CP_UTF8, + 0, + buf.base, + buf.len, + NULL, + 0); + + if (utf16_buf_used == 0) { + *error = GetLastError(); + break; + } - if (utf16_buf_used == 0) { - *error = GetLastError(); - break; - } + max_len = (utf16_buf_used + 1) * sizeof(WCHAR); + allocate = max_len > MAX_CONSOLE_CHAR; + if (allocate) + utf16_buffer = uv__malloc(max_len); + if (!MultiByteToWideChar(CP_UTF8, + 0, + buf.base, + buf.len, + utf16_buffer, + utf16_buf_used)) { + if (allocate) + uv__free(utf16_buffer); + *error = GetLastError(); + break; + } - if (!MultiByteToWideChar(CP_UTF8, - 0, - buf.base, - buf.len, - utf16_buf, - utf16_buf_used)) { - *error = GetLastError(); - break; - } + FLUSH_TEXT(); - FLUSH_TEXT(); - continue; - } + continue; + } for (j = 0; j < buf.len; j++) { unsigned char c = buf.base[j]; diff --git a/Utilities/cmlibuv/src/win/winapi.h b/Utilities/cmlibuv/src/win/winapi.h index 597a93d..4b0eeca 100644 --- a/Utilities/cmlibuv/src/win/winapi.h +++ b/Utilities/cmlibuv/src/win/winapi.h @@ -4615,6 +4615,10 @@ typedef NTSTATUS (NTAPI *sNtQueryDirectoryFile) #endif /* from winerror.h */ +#ifndef ERROR_ELEVATION_REQUIRED +# define ERROR_ELEVATION_REQUIRED 740 +#endif + #ifndef ERROR_SYMLINK_NOT_SUPPORTED # define ERROR_SYMLINK_NOT_SUPPORTED 1464 #endif |