pro2cmake: Fix qmake parser's line continuation handling
The qmake parser of pro2cmake handles completely commented lines to make assignments like this work: SUBDIRS = \ foo \ # bar \ bar However, assignments like SUBDIRS = \ foo \ #bar \ bar were cut off at the commented line. Fix this by allowing leading whitespace for "fully commented lines". Change-Id: Ib5de850a02fd9b9ebb7c056c2f64f9d684334b08 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
46f8c46bee
commit
067fb7915a
@ -20,21 +20,23 @@ if(MACOS AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
|||||||
add_subdirectory(macplist)
|
add_subdirectory(macplist)
|
||||||
add_subdirectory(qaccessibilitymac)
|
add_subdirectory(qaccessibilitymac)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt::Gui)
|
if(TARGET Qt::Network)
|
||||||
add_subdirectory(qcomplextext)
|
add_subdirectory(networkselftest)
|
||||||
endif()
|
|
||||||
if(QT_FEATURE_process AND TARGET Qt::Gui)
|
|
||||||
add_subdirectory(qprocess_and_guieventloop)
|
|
||||||
endif()
|
endif()
|
||||||
if(QT_FEATURE_accessibility AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
if(QT_FEATURE_accessibility AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
||||||
add_subdirectory(qaccessibility)
|
add_subdirectory(qaccessibility)
|
||||||
endif()
|
endif()
|
||||||
|
if(TARGET Qt::Gui)
|
||||||
|
add_subdirectory(qcomplextext)
|
||||||
|
endif()
|
||||||
|
add_subdirectory(qobjectrace)
|
||||||
|
add_subdirectory(toolsupport)
|
||||||
|
if(QT_FEATURE_process AND TARGET Qt::Gui)
|
||||||
|
add_subdirectory(qprocess_and_guieventloop)
|
||||||
|
endif()
|
||||||
if(QT_FEATURE_accessibility_atspi_bridge AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
if(QT_FEATURE_accessibility_atspi_bridge AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
||||||
add_subdirectory(qaccessibilitylinux)
|
add_subdirectory(qaccessibilitylinux)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt::Network)
|
|
||||||
add_subdirectory(networkselftest)
|
|
||||||
endif()
|
|
||||||
if(MACOS AND TARGET Qt::Gui)
|
if(MACOS AND TARGET Qt::Gui)
|
||||||
add_subdirectory(macnativeevents)
|
add_subdirectory(macnativeevents)
|
||||||
endif()
|
endif()
|
||||||
|
@ -20,21 +20,23 @@ if(MACOS AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
|||||||
add_subdirectory(macplist)
|
add_subdirectory(macplist)
|
||||||
add_subdirectory(qaccessibilitymac)
|
add_subdirectory(qaccessibilitymac)
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt::Gui)
|
if(TARGET Qt::Network)
|
||||||
add_subdirectory(qcomplextext)
|
add_subdirectory(networkselftest)
|
||||||
endif()
|
|
||||||
if(QT_FEATURE_process AND TARGET Qt::Gui)
|
|
||||||
add_subdirectory(qprocess_and_guieventloop)
|
|
||||||
endif()
|
endif()
|
||||||
if(QT_FEATURE_accessibility AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
if(QT_FEATURE_accessibility AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
||||||
add_subdirectory(qaccessibility)
|
add_subdirectory(qaccessibility)
|
||||||
endif()
|
endif()
|
||||||
|
if(TARGET Qt::Gui)
|
||||||
|
add_subdirectory(qcomplextext)
|
||||||
|
endif()
|
||||||
|
add_subdirectory(qobjectrace)
|
||||||
|
add_subdirectory(toolsupport)
|
||||||
|
if(QT_FEATURE_process AND TARGET Qt::Gui)
|
||||||
|
add_subdirectory(qprocess_and_guieventloop)
|
||||||
|
endif()
|
||||||
if(QT_FEATURE_accessibility_atspi_bridge AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
if(QT_FEATURE_accessibility_atspi_bridge AND TARGET Qt::Gui AND TARGET Qt::Widgets)
|
||||||
#add_subdirectory(qaccessibilitylinux) # special case # This test is broken
|
#add_subdirectory(qaccessibilitylinux) # special case # This test is broken
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt::Network)
|
|
||||||
add_subdirectory(networkselftest)
|
|
||||||
endif()
|
|
||||||
if(MACOS AND TARGET Qt::Gui)
|
if(MACOS AND TARGET Qt::Gui)
|
||||||
# add_subdirectory(macnativeevents) # special case it's disabled in qmake too
|
# add_subdirectory(macnativeevents) # special case it's disabled in qmake too
|
||||||
endif()
|
endif()
|
||||||
|
@ -54,6 +54,7 @@ def fixup_comments(contents: str) -> str:
|
|||||||
# Get rid of completely commented out lines.
|
# Get rid of completely commented out lines.
|
||||||
# So any line which starts with a '#' char and ends with a new line
|
# So any line which starts with a '#' char and ends with a new line
|
||||||
# will be replaced by a single new line.
|
# will be replaced by a single new line.
|
||||||
|
# The # may be preceded by any number of spaces or tabs.
|
||||||
#
|
#
|
||||||
# This is needed because qmake syntax is weird. In a multi line
|
# This is needed because qmake syntax is weird. In a multi line
|
||||||
# assignment (separated by backslashes and newlines aka
|
# assignment (separated by backslashes and newlines aka
|
||||||
@ -67,7 +68,7 @@ def fixup_comments(contents: str) -> str:
|
|||||||
# care of it as well, as if the commented line didn't exist in the
|
# care of it as well, as if the commented line didn't exist in the
|
||||||
# first place.
|
# first place.
|
||||||
|
|
||||||
contents = re.sub(r"\n#[^\n]*?\n", "\n", contents, re.DOTALL)
|
contents = re.sub(r"\n[ \t]*#[^\n]*?\n", "\n", contents, re.DOTALL)
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user