Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
72057d9c
Commit
72057d9c
authored
Feb 13, 2019
by
Brad King
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fortran: Thread compiler id through to internal Fortran parser
parent
7ae329e2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
5 deletions
+26
-5
Source/cmDependsFortran.cxx
Source/cmDependsFortran.cxx
+6
-1
Source/cmDependsFortran.h
Source/cmDependsFortran.h
+2
-0
Source/cmFortranParser.h
Source/cmFortranParser.h
+9
-1
Source/cmFortranParserImpl.cxx
Source/cmFortranParserImpl.cxx
+4
-2
Source/cmGlobalNinjaGenerator.cxx
Source/cmGlobalNinjaGenerator.cxx
+5
-1
No files found.
Source/cmDependsFortran.cxx
View file @
72057d9c
...
...
@@ -94,6 +94,8 @@ cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
}
this
->
PPDefinitions
.
insert
(
def
);
}
this
->
CompilerId
=
mf
->
GetSafeDefinition
(
"CMAKE_Fortran_COMPILER_ID"
);
}
cmDependsFortran
::~
cmDependsFortran
()
...
...
@@ -116,6 +118,9 @@ bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
return
false
;
}
cmFortranCompiler
fc
;
fc
.
Id
=
this
->
CompilerId
;
bool
okay
=
true
;
for
(
std
::
string
const
&
src
:
sources
)
{
// Get the information object for this source.
...
...
@@ -123,7 +128,7 @@ bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
// Create the parser object. The constructor takes info by reference,
// so we may look into the resulting objects later.
cmFortranParser
parser
(
this
->
IncludePath
,
this
->
PPDefinitions
,
info
);
cmFortranParser
parser
(
fc
,
this
->
IncludePath
,
this
->
PPDefinitions
,
info
);
// Push on the starting file.
cmFortranParser_FilePush
(
&
parser
,
src
.
c_str
());
...
...
Source/cmDependsFortran.h
View file @
72057d9c
...
...
@@ -77,6 +77,8 @@ protected:
// The source file from which to start scanning.
std
::
string
SourceFile
;
std
::
string
CompilerId
;
std
::
set
<
std
::
string
>
PPDefinitions
;
// Internal implementation details.
...
...
Source/cmFortranParser.h
View file @
72057d9c
...
...
@@ -128,9 +128,14 @@ struct cmFortranFile
bool
LastCharWasNewline
;
};
struct
cmFortranCompiler
{
std
::
string
Id
;
};
struct
cmFortranParser_s
{
cmFortranParser_s
(
std
::
vector
<
std
::
string
>
includes
,
cmFortranParser_s
(
cmFortranCompiler
fc
,
std
::
vector
<
std
::
string
>
includes
,
std
::
set
<
std
::
string
>
defines
,
cmFortranSourceInfo
&
info
);
~
cmFortranParser_s
();
...
...
@@ -141,6 +146,9 @@ struct cmFortranParser_s
std
::
string
SModName
(
std
::
string
const
&
mod_name
,
std
::
string
const
&
sub_name
)
const
;
// What compiler.
cmFortranCompiler
Compiler
;
// The include file search path.
std
::
vector
<
std
::
string
>
IncludePath
;
...
...
Source/cmFortranParserImpl.cxx
View file @
72057d9c
...
...
@@ -43,10 +43,12 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir,
return
false
;
}
cmFortranParser_s
::
cmFortranParser_s
(
std
::
vector
<
std
::
string
>
includes
,
cmFortranParser_s
::
cmFortranParser_s
(
cmFortranCompiler
fc
,
std
::
vector
<
std
::
string
>
includes
,
std
::
set
<
std
::
string
>
defines
,
cmFortranSourceInfo
&
info
)
:
IncludePath
(
std
::
move
(
includes
))
:
Compiler
(
std
::
move
(
fc
))
,
IncludePath
(
std
::
move
(
includes
))
,
PPDefinitions
(
std
::
move
(
defines
))
,
Info
(
info
)
{
...
...
Source/cmGlobalNinjaGenerator.cxx
View file @
72057d9c
...
...
@@ -1679,6 +1679,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
return
1
;
}
cmFortranCompiler
fc
;
std
::
vector
<
std
::
string
>
includes
;
{
Json
::
Value
tdio
;
...
...
@@ -1700,11 +1701,14 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
includes
.
push_back
(
tdi_include_dir
.
asString
());
}
}
Json
::
Value
const
&
tdi_compiler_id
=
tdi
[
"compiler-id"
];
fc
.
Id
=
tdi_compiler_id
.
asString
();
}
cmFortranSourceInfo
info
;
std
::
set
<
std
::
string
>
defines
;
cmFortranParser
parser
(
includes
,
defines
,
info
);
cmFortranParser
parser
(
fc
,
includes
,
defines
,
info
);
if
(
!
cmFortranParser_FilePush
(
&
parser
,
arg_pp
.
c_str
()))
{
cmSystemTools
::
Error
(
"-E cmake_ninja_depends failed to open "
,
arg_pp
.
c_str
());
...
...
Brad King
@brad.king
mentioned in commit
0069825f
·
Feb 14, 2019
mentioned in commit
0069825f
mentioned in commit 0069825f50c83b8144374150dd682d48c84f6874
Toggle commit list
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