Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
8665e27e
Commit
8665e27e
authored
Feb 16, 2019
by
Sang Ik Lee
Committed by
Robert Kimball
Feb 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect header resource. (#2467)
parent
0bdb051a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
36 deletions
+24
-36
CMakeLists.txt
src/resource/CMakeLists.txt
+9
-15
main.cpp
src/resource/main.cpp
+15
-21
No files found.
src/resource/CMakeLists.txt
View file @
8665e27e
...
...
@@ -25,13 +25,15 @@ set (SRC
header_rewrite.cpp
)
set
(
LLVM_LIB_DIR
${
LLVM_INCLUDE_DIR
}
/../lib/clang/5.0.2/include
)
get_filename_component
(
LLVM_LIB_DIR
${
LLVM_LIB_DIR
}
ABSOLUTE
)
list
(
APPEND HEADER_SEARCH_DEFINES CLANG_BUILTIN_HEADERS_PATH=
"
${
LLVM_LIB_DIR
}
"
)
add_executable
(
resource_generator EXCLUDE_FROM_ALL
${
SRC
}
)
add_dependencies
(
resource_generator libllvm
)
get_target_property
(
LLVM_INCLUDE_DIR libllvm INTERFACE_INCLUDE_DIRECTORIES
)
get_filename_component
(
CLANG_INCLUDE_DIR
${
LLVM_INCLUDE_DIR
}
/../lib/clang/5.0.2/include ABSOLUTE
)
list
(
APPEND HEADER_SEARCH_DEFINES CLANG_BUILTIN_HEADERS_PATH=
"
${
CLANG_INCLUDE_DIR
}
"
)
list
(
APPEND HEADER_SEARCH_DEFINES NGRAPH_HEADERS_PATH=
"
${
NGRAPH_INCLUDE_PATH
}
"
)
if
(
NGRAPH_CPU_ENABLE
)
add_dependencies
(
resource_generator libmkldnn libeigen
)
get_target_property
(
MKLDNN_INCLUDE_DIR libmkldnn INTERFACE_INCLUDE_DIRECTORIES
)
get_target_property
(
EIGEN_INCLUDE_DIR libeigen INTERFACE_INCLUDE_DIRECTORIES
)
list
(
APPEND HEADER_SEARCH_DEFINES EIGEN_HEADERS_PATH=
"
${
EIGEN_INCLUDE_DIR
}
"
)
...
...
@@ -39,17 +41,9 @@ if(NGRAPH_CPU_ENABLE)
endif
()
if
(
NGRAPH_TBB_ENABLE
)
list
(
APPEND HEADER_SEARCH_DEFINES TBB_HEADERS_PATH=
"
${
TBB_ROOT
}
/include"
)
endif
()
add_executable
(
resource_generator EXCLUDE_FROM_ALL
${
SRC
}
)
if
(
NOT NGRAPH_DEX_ONLY
)
add_dependencies
(
resource_generator ext_llvm
)
endif
()
if
(
NGRAPH_CPU_ENABLE
)
add_dependencies
(
resource_generator ext_eigen ext_mkldnn
)
add_dependencies
(
resource_generator libtbb
)
get_target_property
(
TBB_INCLUDE_DIR libtbb INTERFACE_INCLUDE_DIRECTORIES
)
list
(
APPEND HEADER_SEARCH_DEFINES TBB_HEADERS_PATH=
"
${
TBB_INCLUDE_DIR
}
"
)
endif
()
set_source_files_properties
(
main.cpp PROPERTIES COMPILE_DEFINITIONS
"
${
HEADER_SEARCH_DEFINES
}
"
)
...
...
src/resource/main.cpp
View file @
8665e27e
...
...
@@ -68,6 +68,7 @@ int main(int argc, char** argv)
{
time_t
main_timestamp
=
get_timestamp
(
argv
[
0
]);
static
vector
<
string
>
valid_ext
=
{
".h"
,
".hpp"
,
".tcc"
,
""
};
static
vector
<
string
>
invalid_file
=
{
"README"
};
string
output_path
;
string
base_name
;
...
...
@@ -86,31 +87,18 @@ int main(int argc, char** argv)
vector
<
ResourceInfo
>
include_paths
;
#ifdef __APPLE__
#ifdef EIGEN_HEADERS_PATH
include_paths
.
push_back
({
EIGEN_HEADERS_PATH
,
{},
true
});
#endif
#ifdef MKLDNN_HEADERS_PATH
include_paths
.
push_back
({
MKLDNN_HEADERS_PATH
,
{},
true
});
#endif
#ifdef TBB_HEADERS_PATH
include_paths
.
push_back
({
TBB_HEADERS_PATH
,
{},
true
});
#endif
include_paths
.
push_back
({
NGRAPH_HEADERS_PATH
,
{},
true
});
include_paths
.
push_back
({
CLANG_BUILTIN_HEADERS_PATH
,
{},
true
});
#else // __APPLE__
include_paths
.
push_back
({
CLANG_BUILTIN_HEADERS_PATH
,
{},
true
});
#ifdef EIGEN_HEADERS_PATH
include_paths
.
push_back
({
EIGEN_HEADERS_PATH
,
{},
true
});
include_paths
.
push_back
({
EIGEN_HEADERS_PATH
,
{
"Eigen"
},
true
});
#endif
#ifdef MKLDNN_HEADERS_PATH
include_paths
.
push_back
({
MKLDNN_HEADERS_PATH
,
{},
true
});
#endif
include_paths
.
push_back
({
NGRAPH_HEADERS_PATH
,
{},
true
});
#ifdef TBB_HEADERS_PATH
include_paths
.
push_back
({
TBB_HEADERS_PATH
,
{},
true
});
#endif
#endif
include_paths
.
push_back
({
NGRAPH_HEADERS_PATH
,
{
"ngraph"
},
true
});
if
(
output_path
.
empty
())
{
...
...
@@ -124,7 +112,10 @@ int main(int argc, char** argv)
{
// cout << "path " << path.source_path << " -> " << path.target_path << endl;
vector
<
string
>
path_list
;
path_list
.
push_back
(
path
.
search_path
);
if
(
path
.
subdirs
.
empty
())
{
path_list
.
push_back
(
path
.
search_path
);
}
for
(
const
string
&
p
:
path
.
subdirs
)
{
path_list
.
push_back
(
path_join
(
path
.
search_path
,
p
));
...
...
@@ -135,11 +126,14 @@ int main(int argc, char** argv)
[
&
](
const
string
&
file
,
bool
is_dir
)
{
if
(
!
is_dir
)
{
string
ext
=
get_file_ext
(
file
);
if
(
contains
(
valid_ext
,
ext
))
if
(
!
contains
(
invalid_file
,
file
))
{
// cout << "add " << path.search_path << ", " << file << endl;
path
.
files
.
push_back
(
file
);
string
ext
=
get_file_ext
(
file
);
if
(
contains
(
valid_ext
,
ext
))
{
// cout << "add " << path.search_path << ", " << file << endl;
path
.
files
.
push_back
(
file
);
}
}
}
},
...
...
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