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
06a0f67f
Commit
06a0f67f
authored
23 years ago
by
Berk Geveci
Browse files
Options
Downloads
Patches
Plain Diff
1. Added EXCLUDE option to LOAD_CACHE.
2. Entries brought in from another cache are now marked as internal.
parent
1cf9a356
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Source/cmCacheManager.cxx
+42
-8
42 additions, 8 deletions
Source/cmCacheManager.cxx
Source/cmCacheManager.h
+2
-0
2 additions, 0 deletions
Source/cmCacheManager.h
Source/cmLoadCacheCommand.cxx
+28
-5
28 additions, 5 deletions
Source/cmLoadCacheCommand.cxx
with
72 additions
and
13 deletions
Source/cmCacheManager.cxx
+
42
−
8
View file @
06a0f67f
...
...
@@ -106,8 +106,17 @@ bool cmCacheManager::LoadCache(const char* path)
{
return
this
->
LoadCache
(
path
,
true
);
}
bool
cmCacheManager
::
LoadCache
(
const
char
*
path
,
bool
internal
)
{
std
::
set
<
std
::
string
>
emptySet
;
return
this
->
LoadCache
(
path
,
internal
,
emptySet
);
}
bool
cmCacheManager
::
LoadCache
(
const
char
*
path
,
bool
internal
,
std
::
set
<
std
::
string
>&
excludes
)
{
std
::
string
cacheFile
=
path
;
cacheFile
+=
"/CMakeCache.txt"
;
...
...
@@ -127,6 +136,9 @@ bool cmCacheManager::LoadCache(const char* path,
cmRegularExpression
reg
(
"^([^:]*):([^=]*)=(.*[^
\t
]|[
\t
]*)[
\t
]*$"
);
// input line is: "key":type=value
cmRegularExpression
regQuoted
(
"^
\"
([^
\"
]*)
\"
:([^=]*)=(.*[^
\t
]|[
\t
]*)[
\t
]*$"
);
std
::
set
<
std
::
string
>::
const_iterator
iter
;
std
::
string
entryKey
;
while
(
fin
)
{
// Format is key:type=value
...
...
@@ -148,22 +160,44 @@ bool cmCacheManager::LoadCache(const char* path,
}
if
(
regQuoted
.
find
(
buffer
))
{
e
.
m_Type
=
cmCacheManager
::
StringToType
(
regQuoted
.
match
(
2
).
c_str
());
// only load internal values if internal is set
if
(
internal
||
e
.
m_Type
!=
INTERNAL
)
entryKey
=
regQuoted
.
match
(
1
);
if
(
excludes
.
find
(
entryKey
)
==
excludes
.
end
()
)
{
e
.
m_Type
=
cmCacheManager
::
StringToType
(
regQuoted
.
match
(
2
).
c_str
());
// only load internal values if internal is set
if
(
internal
||
e
.
m_Type
!=
INTERNAL
)
{
// If we are loading the cache from another project,
// make all loaded entries internal so that it is
// not visible in the gui
if
(
!
internal
)
{
e
.
m_Type
=
INTERNAL
;
}
e
.
m_Value
=
regQuoted
.
match
(
3
);
m_Cache
[
regQuoted
.
match
(
1
)]
=
e
;
m_Cache
[
entryKey
]
=
e
;
}
}
}
else
if
(
reg
.
find
(
buffer
))
{
e
.
m_Type
=
cmCacheManager
::
StringToType
(
reg
.
match
(
2
).
c_str
());
// only load internal values if internal is set
if
(
internal
||
e
.
m_Type
!=
INTERNAL
)
entryKey
=
reg
.
match
(
1
);
if
(
excludes
.
find
(
entryKey
)
==
excludes
.
end
()
)
{
e
.
m_Type
=
cmCacheManager
::
StringToType
(
reg
.
match
(
2
).
c_str
());
// only load internal values if internal is set
if
(
internal
||
e
.
m_Type
!=
INTERNAL
)
{
// If we are loading the cache from another project,
// make all loaded entries internal so that it is
// not visible in the gui
if
(
!
internal
)
{
e
.
m_Type
=
INTERNAL
;
}
e
.
m_Value
=
reg
.
match
(
3
);
m_Cache
[
reg
.
match
(
1
)]
=
e
;
m_Cache
[
entryKey
]
=
e
;
}
}
}
else
...
...
This diff is collapsed.
Click to expand it.
Source/cmCacheManager.h
+
2
−
0
View file @
06a0f67f
...
...
@@ -78,6 +78,8 @@ public:
///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool
LoadCache
(
const
char
*
path
);
bool
LoadCache
(
const
char
*
path
,
bool
internal
);
bool
LoadCache
(
const
char
*
path
,
bool
internal
,
std
::
set
<
std
::
string
>&
excludes
);
///! Put cache definitions into makefile
void
DefineCache
(
cmMakefile
*
);
...
...
This diff is collapsed.
Click to expand it.
Source/cmLoadCacheCommand.cxx
+
28
−
5
View file @
06a0f67f
...
...
@@ -21,16 +21,39 @@ bool cmLoadCacheCommand::InitialPass(std::vector<std::string>& args)
{
if
(
args
.
size
()
<
1
)
{
this
->
SetError
(
"called with wrong number of arguments."
);
this
->
SetError
(
"called with wrong number of arguments."
);
}
for
(
unsigned
int
i
=
0
;
i
<
args
.
size
();
i
++
)
bool
excludeFiles
=
false
;
unsigned
int
excludeIndex
=
0
;
unsigned
int
i
;
std
::
set
<
std
::
string
>
excludes
;
for
(
i
=
0
;
i
<
args
.
size
();
i
++
)
{
m_Makefile
->
ExpandVariablesInString
(
args
[
i
]);
cmCacheManager
::
GetInstance
()
->
LoadCache
(
args
[
i
].
c_str
(),
false
);
cmCacheManager
::
GetInstance
()
->
DefineCache
(
m_Makefile
);
if
(
excludeFiles
)
{
m_Makefile
->
ExpandVariablesInString
(
args
[
i
]);
excludes
.
insert
(
args
[
i
]);
}
if
(
args
[
i
]
==
"EXCLUDE"
)
{
excludeFiles
=
true
;
}
}
for
(
i
=
0
;
i
<
args
.
size
();
i
++
)
{
if
(
args
[
i
]
==
"EXCLUDE"
)
{
break
;
}
m_Makefile
->
ExpandVariablesInString
(
args
[
i
]);
cmCacheManager
::
GetInstance
()
->
LoadCache
(
args
[
i
].
c_str
(),
false
,
excludes
);
cmCacheManager
::
GetInstance
()
->
DefineCache
(
m_Makefile
);
}
return
true
;
}
...
...
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