@@ -14,7 +14,7 @@ SET(ANAKIN_SABER_LIB ${ANAKIN_LIBRARY}/libanakin_saber_common.so)
14
14
# nearly all the header files.
15
15
function (fetch_include_recursively root_dir )
16
16
if (IS_DIRECTORY ${root_dir} )
17
- include_directories (${root_dir} )
17
+ include_directories (BEFORE ${root_dir} )
18
18
endif ()
19
19
20
20
file (GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir} /* )
@@ -26,20 +26,6 @@ function(fetch_include_recursively root_dir)
26
26
endfunction ()
27
27
fetch_include_recursively (${ANAKIN_INCLUDE} )
28
28
29
- # A nother helper function used in Anakin.
30
- function (target_fetch_include_recursively root_dir target_name )
31
- if (IS_DIRECTORY ${root_dir} )
32
- target_include_directories (${target_name} PUBLIC ${root_dir} )
33
- endif ()
34
-
35
- file (GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir} /* )
36
- foreach (sub ${ALL_SUB} )
37
- if (IS_DIRECTORY ${root_dir} /${sub} )
38
- target_include_directories (${target_name} PUBLIC ${root_dir} /${sub} )
39
- endif ()
40
- endforeach ()
41
- endfunction ()
42
-
43
29
set (ANAKIN_COMPILE_EXTRA_FLAGS
44
30
-Wno-error=unused-but-set-variable -Wno-unused-but-set-variable
45
31
-Wno-error=unused-variable -Wno-unused-variable
@@ -56,6 +42,7 @@ set(ANAKIN_COMPILE_EXTRA_FLAGS
56
42
ExternalProject_Add (
57
43
extern_anakin
58
44
${EXTERNAL_PROJECT_LOG_ARGS}
45
+ # TODO(luotao): use PaddlePaddle/Anakin later
59
46
GIT_REPOSITORY "https://github.com/luotao1/Anakin"
60
47
GIT_TAG "3957ae9263eaa0b1986758dac60a88852afb09be"
61
48
PREFIX ${ANAKIN_SOURCE_DIR}
@@ -73,6 +60,7 @@ ExternalProject_Add(
73
60
message (STATUS "Anakin for inference is enabled" )
74
61
message (STATUS "Anakin is set INCLUDE:${ANAKIN_INCLUDE} LIBRARY:${ANAKIN_LIBRARY} " )
75
62
63
+ fetch_include_recursively (${ANAKIN_INCLUDE} )
76
64
add_dependencies (extern_anakin protobuf mklml )
77
65
add_library (anakin SHARED IMPORTED GLOBAL )
78
66
set_property (TARGET anakin PROPERTY IMPORTED_LOCATION ${ANAKIN_SHARED_LIB} )
0 commit comments