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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
André Pedro
CMake
Commits
6c9b3b5c
Commit
6c9b3b5c
authored
8 years ago
by
Daniel Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
cmCommand: implement functions in cxx file
parent
8483dab8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Source/CMakeLists.txt
+2
-0
2 additions, 0 deletions
Source/CMakeLists.txt
Source/cmCommand.cxx
+48
-0
48 additions, 0 deletions
Source/cmCommand.cxx
Source/cmCommand.h
+6
-42
6 additions, 42 deletions
Source/cmCommand.h
bootstrap
+1
-0
1 addition, 0 deletions
bootstrap
with
57 additions
and
42 deletions
Source/CMakeLists.txt
+
2
−
0
View file @
6c9b3b5c
...
...
@@ -386,6 +386,8 @@ set(SRCS
cmake.cxx
cmake.h
cmCommand.cxx
cmCommand.h
cmCommands.cxx
cmCommands.h
cmAddCompileOptionsCommand.cxx
...
...
This diff is collapsed.
Click to expand it.
Source/cmCommand.cxx
0 → 100644
+
48
−
0
View file @
6c9b3b5c
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include
"cmCommand.h"
bool
cmCommand
::
InvokeInitialPass
(
const
std
::
vector
<
cmListFileArgument
>&
args
,
cmExecutionStatus
&
status
)
{
std
::
vector
<
std
::
string
>
expandedArguments
;
if
(
!
this
->
Makefile
->
ExpandArguments
(
args
,
expandedArguments
))
{
// There was an error expanding arguments. It was already
// reported, so we can skip this command without error.
return
true
;
}
return
this
->
InitialPass
(
expandedArguments
,
status
);
}
const
char
*
cmCommand
::
GetError
()
{
if
(
this
->
Error
.
empty
())
{
this
->
Error
=
this
->
GetName
();
this
->
Error
+=
" unknown error."
;
}
return
this
->
Error
.
c_str
();
}
void
cmCommand
::
SetError
(
const
std
::
string
&
e
)
{
this
->
Error
=
this
->
GetName
();
this
->
Error
+=
" "
;
this
->
Error
+=
e
;
}
bool
cmCommand
::
Disallowed
(
cmPolicies
::
PolicyID
pol
,
const
char
*
e
)
{
switch
(
this
->
Makefile
->
GetPolicyStatus
(
pol
))
{
case
cmPolicies
::
WARN
:
this
->
Makefile
->
IssueMessage
(
cmake
::
AUTHOR_WARNING
,
cmPolicies
::
GetPolicyWarning
(
pol
));
case
cmPolicies
::
OLD
:
return
false
;
case
cmPolicies
::
REQUIRED_IF_USED
:
case
cmPolicies
::
REQUIRED_ALWAYS
:
case
cmPolicies
::
NEW
:
this
->
Makefile
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
e
);
break
;
}
return
true
;
}
This diff is collapsed.
Click to expand it.
Source/cmCommand.h
+
6
−
42
View file @
6c9b3b5c
...
...
@@ -28,9 +28,9 @@ public:
* Construct the command. By default it is enabled with no makefile.
*/
cmCommand
()
:
Makefile
(
CM_NULLPTR
)
,
Enabled
(
true
)
{
this
->
Makefile
=
CM_NULLPTR
;
this
->
Enabled
=
true
;
}
/**
...
...
@@ -50,16 +50,7 @@ public:
* arguments and then invokes the InitialPass.
*/
virtual
bool
InvokeInitialPass
(
const
std
::
vector
<
cmListFileArgument
>&
args
,
cmExecutionStatus
&
status
)
{
std
::
vector
<
std
::
string
>
expandedArguments
;
if
(
!
this
->
Makefile
->
ExpandArguments
(
args
,
expandedArguments
))
{
// There was an error expanding arguments. It was already
// reported, so we can skip this command without error.
return
true
;
}
return
this
->
InitialPass
(
expandedArguments
,
status
);
}
cmExecutionStatus
&
status
);
/**
* This is called when the command is first encountered in
...
...
@@ -127,42 +118,15 @@ public:
/**
* Return the last error string.
*/
const
char
*
GetError
()
{
if
(
this
->
Error
.
empty
())
{
this
->
Error
=
this
->
GetName
();
this
->
Error
+=
" unknown error."
;
}
return
this
->
Error
.
c_str
();
}
const
char
*
GetError
();
/**
* Set the error message
*/
void
SetError
(
const
std
::
string
&
e
)
{
this
->
Error
=
this
->
GetName
();
this
->
Error
+=
" "
;
this
->
Error
+=
e
;
}
void
SetError
(
const
std
::
string
&
e
);
/** Check if the command is disallowed by a policy. */
bool
Disallowed
(
cmPolicies
::
PolicyID
pol
,
const
char
*
e
)
{
switch
(
this
->
Makefile
->
GetPolicyStatus
(
pol
))
{
case
cmPolicies
::
WARN
:
this
->
Makefile
->
IssueMessage
(
cmake
::
AUTHOR_WARNING
,
cmPolicies
::
GetPolicyWarning
(
pol
));
case
cmPolicies
::
OLD
:
return
false
;
case
cmPolicies
::
REQUIRED_IF_USED
:
case
cmPolicies
::
REQUIRED_ALWAYS
:
case
cmPolicies
::
NEW
:
this
->
Makefile
->
IssueMessage
(
cmake
::
FATAL_ERROR
,
e
);
break
;
}
return
true
;
}
bool
Disallowed
(
cmPolicies
::
PolicyID
pol
,
const
char
*
e
);
protected
:
cmMakefile
*
Makefile
;
...
...
This diff is collapsed.
Click to expand it.
bootstrap
+
1
−
0
View file @
6c9b3b5c
...
...
@@ -254,6 +254,7 @@ CMAKE_CXX_SOURCES="\
cmCMakePolicyCommand
\
cmCPackPropertiesGenerator
\
cmCacheManager
\
cmCommand
\
cmCommandArgumentLexer
\
cmCommandArgumentParser
\
cmCommandArgumentParserHelper
\
...
...
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