Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattias Ellert
CMake
Commits
4878ed3d
Commit
4878ed3d
authored
23 years ago
by
Ian Scott
Browse files
Options
Downloads
Patches
Plain Diff
MAkefile now strips duplicate directores from the libraries and include paths
parent
6d54c3d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/cmMakefile.cxx
+26
-0
26 additions, 0 deletions
Source/cmMakefile.cxx
Source/cmMakefile.h
+5
-0
5 additions, 0 deletions
Source/cmMakefile.h
with
31 additions
and
0 deletions
Source/cmMakefile.cxx
+
26
−
0
View file @
4878ed3d
...
...
@@ -408,6 +408,9 @@ void cmMakefile::FinalPass()
{
// do all the variable expansions here
this
->
ExpandVariables
();
this
->
StripDuplicateDirectories
();
// give all the commands a chance to do something
// after the file has been parsed before generation
for
(
std
::
vector
<
cmCommand
*>::
iterator
i
=
m_UsedCommands
.
begin
();
...
...
@@ -790,6 +793,29 @@ int cmMakefile::DumpDocumentationToFile(const char *fileName)
}
// Remove duplicate directories from the library and include paths.
void
cmMakefile
::
StripDuplicateDirectories
()
{
std
::
vector
<
std
::
string
>::
iterator
begin
,
end
;
// remove duplicates from m_IncludeDirectories
begin
=
m_IncludeDirectories
.
begin
();
end
=
m_IncludeDirectories
.
end
();
std
::
list
<
std
::
string
>
tmp1
(
begin
,
end
);
tmp1
.
sort
();
m_IncludeDirectories
.
clear
();
std
::
unique_copy
(
tmp1
.
begin
(),
tmp1
.
end
(),
std
::
back_inserter
(
m_IncludeDirectories
));
// remove duplicates from m_LinkDirectories
begin
=
m_LinkDirectories
.
begin
();
end
=
m_LinkDirectories
.
end
();
std
::
list
<
std
::
string
>
tmp2
(
begin
,
end
);
tmp2
.
sort
();
m_LinkDirectories
.
clear
();
std
::
unique_copy
(
tmp2
.
begin
(),
tmp2
.
end
(),
std
::
back_inserter
(
m_LinkDirectories
));
}
void
cmMakefile
::
ExpandVariablesInString
(
std
::
string
&
source
)
const
{
this
->
ExpandVariablesInString
(
source
,
false
);
...
...
This diff is collapsed.
Click to expand it.
Source/cmMakefile.h
+
5
−
0
View file @
4878ed3d
...
...
@@ -480,6 +480,11 @@ public:
* Expand variables in the makefiles ivars such as link directories etc
*/
void
ExpandVariables
();
/**
* Strip Duplicate directories from Library and Include paths
*/
void
cmMakefile
::
StripDuplicateDirectories
();
/** Recursivly read and create a cmMakefile object for
* all CMakeLists.txt files in the GetSubDirectories list.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment