Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
75e23cc5
Commit
75e23cc5
authored
Nov 09, 2009
by
dt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -spec handling
parent
4769ceb0
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
213 additions
and
140 deletions
+213
-140
src/plugins/projectexplorer/debugginghelper.cpp
src/plugins/projectexplorer/debugginghelper.cpp
+3
-3
src/plugins/projectexplorer/debugginghelper.h
src/plugins/projectexplorer/debugginghelper.h
+1
-1
src/plugins/qt4projectmanager/projectloadwizard.cpp
src/plugins/qt4projectmanager/projectloadwizard.cpp
+11
-0
src/plugins/qt4projectmanager/qmakestep.cpp
src/plugins/qt4projectmanager/qmakestep.cpp
+1
-1
src/plugins/qt4projectmanager/qt4project.cpp
src/plugins/qt4projectmanager/qt4project.cpp
+71
-4
src/plugins/qt4projectmanager/qt4project.h
src/plugins/qt4projectmanager/qt4project.h
+1
-0
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
+11
-1
src/plugins/qt4projectmanager/qtversionmanager.cpp
src/plugins/qt4projectmanager/qtversionmanager.cpp
+112
-125
src/plugins/qt4projectmanager/qtversionmanager.h
src/plugins/qt4projectmanager/qtversionmanager.h
+2
-5
No files found.
src/plugins/projectexplorer/debugginghelper.cpp
View file @
75e23cc5
...
...
@@ -132,7 +132,7 @@ QString DebuggingHelperLibrary::buildDebuggingHelperLibrary(const QString &qmake
const
QString
directory
=
copyDebuggingHelperLibrary
(
qtInstallDataDir
(
qmakePath
),
&
errorMessage
);
if
(
directory
.
isEmpty
())
return
errorMessage
;
return
buildDebuggingHelperLibrary
(
directory
,
make
,
qmakePath
,
env
);
return
buildDebuggingHelperLibrary
(
directory
,
make
,
qmakePath
,
QString
::
null
,
env
);
}
// Copy helper source files to a target directory, replacing older files.
...
...
@@ -188,7 +188,7 @@ QString DebuggingHelperLibrary::copyDebuggingHelperLibrary(const QString &qtInst
return
QString
();
}
QString
DebuggingHelperLibrary
::
buildDebuggingHelperLibrary
(
const
QString
&
directory
,
const
QString
&
makeCommand
,
const
QString
&
qmakeCommand
,
const
Environment
&
env
)
QString
DebuggingHelperLibrary
::
buildDebuggingHelperLibrary
(
const
QString
&
directory
,
const
QString
&
makeCommand
,
const
QString
&
qmakeCommand
,
const
QString
&
mkspec
,
const
Environment
&
env
)
{
QString
output
;
const
QChar
newline
=
QLatin1Char
(
'\n'
);
...
...
@@ -218,7 +218,7 @@ QString DebuggingHelperLibrary::buildDebuggingHelperLibrary(const QString &direc
output
+=
QCoreApplication
::
translate
(
"ProjectExplorer::DebuggingHelperLibrary"
,
"Running %1 ...
\n
"
).
arg
(
qmakeCommand
);
QStringList
makeArgs
;
makeArgs
<<
QLatin1String
(
"-spec"
)
<<
QString
(
QLatin1String
(
"default"
)
)
<<
QLatin1String
(
"gdbmacros.pro"
);
makeArgs
<<
QLatin1String
(
"-spec"
)
<<
(
mkspec
.
isEmpty
()
?
QString
(
QLatin1String
(
"default"
))
:
mkspec
)
<<
QLatin1String
(
"gdbmacros.pro"
);
proc
.
start
(
qmakeCommand
,
makeArgs
);
proc
.
waitForFinished
();
...
...
src/plugins/projectexplorer/debugginghelper.h
View file @
75e23cc5
...
...
@@ -53,7 +53,7 @@ public:
// Build the helpers and return the output log/errormessage.
static
QString
buildDebuggingHelperLibrary
(
const
QString
&
qmakePath
,
const
QString
&
make
,
const
Environment
&
env
);
static
QString
buildDebuggingHelperLibrary
(
const
QString
&
directory
,
const
QString
&
makeCommand
,
const
QString
&
qmakeCommand
,
const
Environment
&
env
);
static
QString
buildDebuggingHelperLibrary
(
const
QString
&
directory
,
const
QString
&
makeCommand
,
const
QString
&
qmakeCommand
,
const
QString
&
mkspec
,
const
Environment
&
env
);
// Copy the source files to a target location and return the chosen target location.
static
QString
copyDebuggingHelperLibrary
(
const
QString
&
qtInstallData
,
QString
*
errorMessage
);
...
...
src/plugins/qt4projectmanager/projectloadwizard.cpp
View file @
75e23cc5
...
...
@@ -67,6 +67,17 @@ ProjectLoadWizard::ProjectLoadWizard(Qt4Project *project, QWidget *parent, Qt::W
QtVersionManager
::
scanMakeFile
(
directory
,
m_importVersion
->
defaultBuildConfig
());
m_importBuildConfig
=
result
.
first
;
m_additionalArguments
=
Qt4Project
::
removeSpecFromArgumentList
(
result
.
second
);
QString
parsedSpec
=
Qt4Project
::
extractSpecFromArgumentList
(
result
.
second
,
directory
,
m_importVersion
);
QString
versionSpec
=
m_importVersion
->
mkspec
();
// Compare mkspecs and add to additional arguments
if
(
parsedSpec
.
isEmpty
()
||
parsedSpec
==
versionSpec
||
parsedSpec
==
"default"
)
{
// using the default spec, don't modify additional arguments
}
else
{
m_additionalArguments
.
prepend
(
parsedSpec
);
m_additionalArguments
.
prepend
(
"-spec"
);
}
}
// So now we have the version and the configuration for that version
...
...
src/plugins/qt4projectmanager/qmakestep.cpp
View file @
75e23cc5
...
...
@@ -65,7 +65,7 @@ QStringList QMakeStep::arguments(const QString &buildConfiguration)
arguments
<<
"-r"
;
if
(
!
additonalArguments
.
contains
(
"-spec"
))
arguments
<<
"-spec"
<<
"default"
;
arguments
<<
"-spec"
<<
m_pro
->
qtVersion
(
bc
)
->
mkspec
()
;
#ifdef Q_OS_WIN
ToolChain
::
ToolChainType
type
=
m_pro
->
toolChainType
(
bc
);
...
...
src/plugins/qt4projectmanager/qt4project.cpp
View file @
75e23cc5
...
...
@@ -1001,6 +1001,58 @@ ProjectExplorer::ToolChain::ToolChainType Qt4Project::toolChainType(BuildConfigu
return
type
;
}
QString
Qt4Project
::
extractSpecFromArgumentList
(
const
QStringList
&
list
,
QString
directory
,
QtVersion
*
version
)
{
int
index
=
list
.
indexOf
(
"-spec"
);
if
(
index
==
-
1
)
index
=
list
.
indexOf
(
"-platform"
);
if
(
index
==
-
1
)
return
QString
();
++
index
;
if
(
index
>=
list
.
length
())
return
QString
();
QString
baseMkspecDir
=
version
->
versionInfo
().
value
(
"QMAKE_MKSPECS"
);
if
(
baseMkspecDir
.
isEmpty
())
baseMkspecDir
=
version
->
versionInfo
().
value
(
"QT_INSTALL_DATA"
)
+
"/mkspecs"
;
QString
parsedSpec
=
QDir
::
cleanPath
(
list
.
at
(
index
));
// if the path is relative it can be
// relative to the working directory (as found in the Makefiles)
// or relatively to the mkspec directory
// if it is the former we need to get the canonical form
// for the other one we don't need to do anything
if
(
QFileInfo
(
parsedSpec
).
isRelative
())
{
if
(
QFileInfo
(
directory
+
"/"
+
parsedSpec
).
exists
())
{
parsedSpec
=
QDir
::
cleanPath
(
directory
+
"/"
+
parsedSpec
);
}
else
{
parsedSpec
=
baseMkspecDir
+
"/"
+
parsedSpec
;
}
}
QFileInfo
f2
(
parsedSpec
);
while
(
f2
.
isSymLink
())
{
parsedSpec
=
f2
.
symLinkTarget
();
f2
.
setFile
(
parsedSpec
);
}
if
(
parsedSpec
.
startsWith
(
baseMkspecDir
))
{
parsedSpec
=
parsedSpec
.
mid
(
baseMkspecDir
.
length
()
+
1
);
}
else
{
QString
sourceMkSpecPath
=
version
->
sourcePath
()
+
"/mkspecs"
;
if
(
parsedSpec
.
startsWith
(
sourceMkSpecPath
))
{
parsedSpec
=
sourceMkSpecPath
.
mid
(
sourceMkSpecPath
.
length
()
+
1
);
}
}
#ifdef Q_OS_WIN
parsedSpec
=
parsedSpec
.
toLower
();
#endif
return
parsedSpec
;
}
BuildConfigWidget
*
Qt4Project
::
createConfigWidget
()
{
return
new
Qt4ProjectConfigWidget
(
this
);
...
...
@@ -1235,16 +1287,31 @@ bool Qt4Project::compareBuildConfigurationToImportFrom(BuildConfiguration *confi
// now compare arguments lists
// we have to compare without the spec/platform cmd argument
// and compare that on its own
QString
actualSpec
=
extractSpecFromArgumentList
(
qs
->
value
(
configuration
->
name
(),
"qmakeArgs"
).
toStringList
(),
workingDirectory
,
version
);
if
(
actualSpec
.
isEmpty
())
{
// Easy one the user has choosen not to override the settings
actualSpec
=
version
->
mkspec
();
}
QString
parsedSpec
=
extractSpecFromArgumentList
(
result
.
second
,
workingDirectory
,
version
);
QStringList
actualArgs
=
removeSpecFromArgumentList
(
qs
->
value
(
configuration
->
name
(),
"qmakeArgs"
).
toStringList
());
QStringList
parsedArgs
=
removeSpecFromArgumentList
(
result
.
second
);
if
(
debug
)
{
// if (debug) {
qDebug
()
<<
"Actual args:"
<<
actualArgs
;
qDebug
()
<<
"Parsed args:"
<<
parsedArgs
;
qDebug
()
<<
"Actual spec:"
<<
actualSpec
;
qDebug
()
<<
"Parsed spec:"
<<
parsedSpec
;
// }
if
(
actualArgs
==
parsedArgs
)
{
// Specs match exactly
if
(
actualSpec
==
parsedSpec
)
return
true
;
// Actual spec is the default one
if
(
actualSpec
==
version
->
mkspec
()
&&
(
parsedSpec
==
"default"
||
parsedSpec
.
isEmpty
()))
return
true
;
}
if
(
actualArgs
==
parsedArgs
)
return
true
;
}
}
}
...
...
src/plugins/qt4projectmanager/qt4project.h
View file @
75e23cc5
...
...
@@ -236,6 +236,7 @@ public:
bool
compareBuildConfigurationToImportFrom
(
ProjectExplorer
::
BuildConfiguration
*
configuration
,
const
QString
&
workingDirectory
);
static
QStringList
removeSpecFromArgumentList
(
const
QStringList
&
old
);
static
QString
extractSpecFromArgumentList
(
const
QStringList
&
list
,
QString
directory
,
QtVersion
*
version
);
signals:
void
targetInformationChanged
();
void
qtVersionChanged
(
ProjectExplorer
::
BuildConfiguration
*
);
...
...
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
View file @
75e23cc5
...
...
@@ -223,6 +223,8 @@ void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
else
bc
->
setValue
(
"buildDirectory"
,
QVariant
(
QString
::
null
));
updateDetails
();
m_pro
->
invalidateCachedTargetInformation
();
updateImportLabel
();
}
void
Qt4ProjectConfigWidget
::
updateImportLabel
()
...
...
@@ -286,7 +288,15 @@ void Qt4ProjectConfigWidget::importLabelClicked()
QPair
<
QtVersion
::
QmakeBuildConfig
,
QStringList
>
result
=
QtVersionManager
::
scanMakeFile
(
directory
,
version
->
defaultBuildConfig
());
QtVersion
::
QmakeBuildConfig
qmakeBuildConfig
=
result
.
first
;
QStringList
additionalArguments
=
result
.
second
;
QStringList
additionalArguments
=
Qt4Project
::
removeSpecFromArgumentList
(
result
.
second
);
QString
parsedSpec
=
Qt4Project
::
extractSpecFromArgumentList
(
result
.
second
,
directory
,
version
);
QString
versionSpec
=
version
->
mkspecPath
();
if
(
parsedSpec
.
isEmpty
()
||
parsedSpec
==
versionSpec
||
parsedSpec
==
"default"
)
{
// using the default spec, don't modify additional arguments
}
else
{
additionalArguments
.
prepend
(
parsedSpec
);
additionalArguments
.
prepend
(
"-spec"
);
}
// So we got all the information now apply it...
m_pro
->
setQtVersion
(
bc
,
version
->
uniqueId
());
...
...
src/plugins/qt4projectmanager/qtversionmanager.cpp
View file @
75e23cc5
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qtversionmanager.h
View file @
75e23cc5
...
...
@@ -142,10 +142,9 @@ private:
static
int
getUniqueId
();
// Also used by QtOptionsPageWidget
void
updateSourcePath
();
void
updateMkSpec
()
const
;
void
updateVersionInfo
()
const
;
QString
findQtBinary
(
const
QStringList
&
possibleName
)
const
;
void
updateToolChain
()
const
;
void
updateToolChain
AndMkspec
()
const
;
QString
m_name
;
QString
m_sourcePath
;
QString
m_mingwDirectory
;
...
...
@@ -160,11 +159,9 @@ private:
QString
m_gcceDirectory
;
#endif
mutable
bool
m_
mkspec
UpToDate
;
mutable
bool
m_
toolChain
UpToDate
;
mutable
QString
m_mkspec
;
// updated lazily
mutable
QString
m_mkspecFullPath
;
mutable
bool
m_toolChainUpToDate
;
mutable
QList
<
QSharedPointer
<
ProjectExplorer
::
ToolChain
>
>
m_toolChains
;
mutable
bool
m_versionInfoUpToDate
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment