CMake: Remove debug list source files comparison

This was needed in the early days of the CMake port when the list of
source files would change due to being added to the qmake project
files.

Change-Id: I7afd219b24ab7a0d87fce26ba35dac75cf8caa5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-11-19 15:26:54 +01:00
parent 6aa2c58842
commit 7a0bdccadf
4 changed files with 2 additions and 48 deletions

View File

@@ -31,7 +31,7 @@ qtc_link_with_qt()
option(WITH_TESTS "Build Tests" OFF) option(WITH_TESTS "Build Tests" OFF)
add_feature_info("Build tests" ${WITH_TESTS} "") add_feature_info("Build tests" ${WITH_TESTS} "")
option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality (e.g. source file disk checking)" OFF) option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality" OFF)
option(SHOW_BUILD_DATE "Show build date in about dialog" OFF) option(SHOW_BUILD_DATE "Show build date in about dialog" OFF)
option(WITH_SANITIZE "Build with sanitizer enabled" OFF) option(WITH_SANITIZE "Build with sanitizer enabled" OFF)
set(SANITIZE_FLAGS "" CACHE STRING "Sets flags for sanitizer compilation flags used in Debug builds") set(SANITIZE_FLAGS "" CACHE STRING "Sets flags for sanitizer compilation flags used in Debug builds")

View File

@@ -169,8 +169,6 @@ function(add_qtc_library name)
set(_arg_SOURCES ${prefixed_sources}) set(_arg_SOURCES ${prefixed_sources})
endif() endif()
compare_sources_with_existing_disk_files(${name} "${_arg_SOURCES}")
set(library_type SHARED) set(library_type SHARED)
if (_arg_STATIC) if (_arg_STATIC)
set(library_type STATIC) set(library_type STATIC)
@@ -316,7 +314,7 @@ endfunction(add_qtc_library)
function(add_qtc_plugin target_name) function(add_qtc_plugin target_name)
cmake_parse_arguments(_arg cmake_parse_arguments(_arg
"SKIP_DEBUG_CMAKE_FILE_CHECK;SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH" "SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT;SKIP_PCH"
"VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT" "VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT"
"CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES" "CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PLUGIN_TEST_DEPENDS;PROPERTIES"
${ARGN} ${ARGN}
@@ -374,10 +372,6 @@ function(add_qtc_plugin target_name)
set(_arg_COMPAT_VERSION ${_arg_VERSION}) set(_arg_COMPAT_VERSION ${_arg_VERSION})
endif() endif()
if (NOT _arg_SKIP_DEBUG_CMAKE_FILE_CHECK)
compare_sources_with_existing_disk_files(${target_name} "${_arg_SOURCES}")
endif()
# Generate dependency list: # Generate dependency list:
find_dependent_plugins(_DEP_PLUGINS ${_arg_PLUGIN_DEPENDS}) find_dependent_plugins(_DEP_PLUGINS ${_arg_PLUGIN_DEPENDS})

View File

@@ -183,31 +183,6 @@ function(update_cached_list name value)
set("${name}" "${_tmp_list}" CACHE INTERNAL "*** Internal ***") set("${name}" "${_tmp_list}" CACHE INTERNAL "*** Internal ***")
endfunction() endfunction()
function(compare_sources_with_existing_disk_files target_name sources)
if(NOT WITH_DEBUG_CMAKE)
return()
endif()
file(GLOB_RECURSE existing_files RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp" "*.hpp" "*.c" "*.h" "*.ui" "*.qrc")
foreach(file IN LISTS existing_files)
if(NOT ${file} IN_LIST sources)
if (NOT WITH_TESTS AND ${file} MATCHES "test")
continue()
endif()
message(STATUS "${target_name} doesn't include ${file}")
endif()
endforeach()
foreach(source IN LISTS "${sources}")
if(NOT ${source} IN_LIST existing_files)
if (NOT WITH_TESTS AND ${file} MATCHES "test")
continue()
endif()
message(STATUS "${target_name} contains non existing ${source}")
endif()
endforeach()
endfunction(compare_sources_with_existing_disk_files)
function(separate_object_libraries libraries REGULAR_LIBS OBJECT_LIBS OBJECT_LIB_OBJECTS) function(separate_object_libraries libraries REGULAR_LIBS OBJECT_LIBS OBJECT_LIB_OBJECTS)
if (CMAKE_VERSION VERSION_LESS 3.14) if (CMAKE_VERSION VERSION_LESS 3.14)
foreach(lib IN LISTS libraries) foreach(lib IN LISTS libraries)

View File

@@ -45,7 +45,6 @@ add_qtc_plugin(QmlDesigner
EXPLICIT_MOC EXPLICIT_MOC
components/propertyeditor/propertyeditorvalue.h components/propertyeditor/propertyeditorvalue.h
components/connectioneditor/connectionviewwidget.h components/connectioneditor/connectionviewwidget.h
SKIP_DEBUG_CMAKE_FILE_CHECK
EXTRA_TRANSLATIONS EXTRA_TRANSLATIONS
"${PROJECT_SOURCE_DIR}/share/qtcreator/qmldesigner" "${PROJECT_SOURCE_DIR}/share/qtcreator/qmldesigner"
PROPERTIES PROPERTIES
@@ -74,7 +73,6 @@ add_qtc_plugin(assetexporterplugin
assetexporterplugin/dumpers/textnodedumper.h assetexporterplugin/dumpers/textnodedumper.cpp assetexporterplugin/dumpers/textnodedumper.h assetexporterplugin/dumpers/textnodedumper.cpp
assetexporterplugin/assetexporterplugin.qrc assetexporterplugin/assetexporterplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix} PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
SKIP_DEBUG_CMAKE_FILE_CHECK
) )
add_qtc_plugin(componentsplugin add_qtc_plugin(componentsplugin
@@ -90,7 +88,6 @@ add_qtc_plugin(componentsplugin
componentsplugin/entertabdesigneraction.cpp componentsplugin/entertabdesigneraction.h componentsplugin/entertabdesigneraction.cpp componentsplugin/entertabdesigneraction.h
componentsplugin/tabviewindexmodel.cpp componentsplugin/tabviewindexmodel.h componentsplugin/tabviewindexmodel.cpp componentsplugin/tabviewindexmodel.h
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix} PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
SKIP_DEBUG_CMAKE_FILE_CHECK
) )
add_qtc_plugin(qmlpreviewplugin add_qtc_plugin(qmlpreviewplugin
@@ -101,7 +98,6 @@ add_qtc_plugin(qmlpreviewplugin
qmlpreviewplugin/qmlpreviewplugin.cpp qmlpreviewplugin/qmlpreviewplugin.h qmlpreviewplugin/qmlpreviewplugin.cpp qmlpreviewplugin/qmlpreviewplugin.h
qmlpreviewplugin/qmlpreviewplugin.qrc qmlpreviewplugin/qmlpreviewplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix} PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
SKIP_DEBUG_CMAKE_FILE_CHECK
) )
add_qtc_plugin(qtquickplugin add_qtc_plugin(qtquickplugin
@@ -112,7 +108,6 @@ add_qtc_plugin(qtquickplugin
qtquickplugin/qtquickplugin.cpp qtquickplugin/qtquickplugin.h qtquickplugin/qtquickplugin.cpp qtquickplugin/qtquickplugin.h
qtquickplugin/qtquickplugin.qrc qtquickplugin/qtquickplugin.qrc
PLUGIN_PATH ${QmlDesignerPluginInstallPrefix} PLUGIN_PATH ${QmlDesignerPluginInstallPrefix}
SKIP_DEBUG_CMAKE_FILE_CHECK
) )
extend_qtc_plugin(QmlDesigner extend_qtc_plugin(QmlDesigner
@@ -548,13 +543,3 @@ extend_qtc_plugin(QmlDesigner
connectsignaldialog.cpp connectsignaldialog.h connectsignaldialog.cpp connectsignaldialog.h
shortcutwidget.cpp shortcutwidget.h shortcutwidget.cpp shortcutwidget.h
) )
# Do the file comparison at the end, due to all the extend_qtc_plugin calls
if (WITH_DEBUG_CMAKE)
foreach(plugin QmlDesigner componentsplugin qtquickplugin)
unset(plugin_sources)
get_target_property(plugin_sources ${plugin} SOURCES)
list(APPEND QmlDesignerSources ${plugin_sources})
endforeach()
compare_sources_with_existing_disk_files(QmlDesigner "${QmlDesignerSources}")
endif()