Skip to content

Commit ae0d0c4

Browse files
authored
Merge pull request #11803 from Superjomn/bugfix/analysis_compile
fix analysis compile bug
2 parents 066f537 + ba99bc2 commit ae0d0c4

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

paddle/fluid/inference/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ endif()
2828
if(WITH_TESTING)
2929
# both tests/book and analysis depends the models that generated by python/paddle/fluid/tests/book
3030
add_subdirectory(tests/book)
31-
add_subdirectory(analysis)
3231
endif()
3332

33+
add_subdirectory(analysis)
34+
3435
if (TENSORRT_FOUND)
3536
add_subdirectory(tensorrt)
3637
endif()

paddle/fluid/inference/analysis/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@ cc_test(test_dot SRCS dot_tester.cc DEPS analysis)
1313
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)
1414

1515
function (inference_analysis_test TARGET)
16-
set(options "")
17-
set(oneValueArgs "")
18-
set(multiValueArgs SRCS)
19-
cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
16+
if(WITH_TESTING)
17+
set(options "")
18+
set(oneValueArgs "")
19+
set(multiValueArgs SRCS)
20+
cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
2021

21-
cc_test(${TARGET}
22-
SRCS "${analysis_test_SRCS}"
23-
DEPS analysis
24-
ARGS --inference_model_dir=${PYTHON_TESTS_DIR}/book/word2vec.inference.model --fraction_of_gpu_memory_to_use=0.5)
25-
set_tests_properties(${TARGET} PROPERTIES DEPENDS test_word2vec)
22+
cc_test(${TARGET}
23+
SRCS "${analysis_test_SRCS}"
24+
DEPS analysis
25+
ARGS --inference_model_dir=${PYTHON_TESTS_DIR}/book/word2vec.inference.model --fraction_of_gpu_memory_to_use=0.5)
26+
set_tests_properties(${TARGET} PROPERTIES DEPENDS test_word2vec)
27+
endif(WITH_TESTING)
2628
endfunction(inference_analysis_test)
2729

2830
inference_analysis_test(test_data_flow_graph SRCS data_flow_graph_tester.cc)

0 commit comments

Comments
 (0)