diff --git a/paddle/CMakeLists.txt b/paddle/CMakeLists.txt index 2daea052b01adc87f42e15cdcfec92301b7edae9..503024cff338dac42a6a8a32463472dc6b6451d9 100644 --- a/paddle/CMakeLists.txt +++ b/paddle/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(cuda) add_subdirectory(function) add_subdirectory(utils) +add_subdirectory(testing) add_subdirectory(math) add_subdirectory(parameter) add_subdirectory(gserver) diff --git a/paddle/function/CMakeLists.txt b/paddle/function/CMakeLists.txt index c9974487494d2b8a17d702a96ba9748c36c5026c..39bfa169d4f834c827761dcab94aa56de94245b2 100644 --- a/paddle/function/CMakeLists.txt +++ b/paddle/function/CMakeLists.txt @@ -12,11 +12,13 @@ endif() add_library(paddle_function STATIC ${cpp_files} ${cu_objs}) if(WITH_GPU) +if(WITH_TESTING) # TODO: # file(GLOB test_files . *_op_test.cpp) # add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files}) add_simple_unittest(cross_map_normal_op_test) endif() +endif() add_style_check_target(paddle_function ${h_files}) add_style_check_target(paddle_function ${cpp_files}) diff --git a/paddle/testing/CMakeLists.txt b/paddle/testing/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..584498c8602ee5faad3e21a8588af7bb802d7377 --- /dev/null +++ b/paddle/testing/CMakeLists.txt @@ -0,0 +1,6 @@ +# for paddle test case + +if(WITH_TESTING) + add_library(paddle_test_main STATIC TestMain.cpp) + add_dependencies(paddle_test_main gen_proto_cpp) +endif() diff --git a/paddle/utils/TestMain.cpp b/paddle/testing/TestMain.cpp similarity index 100% rename from paddle/utils/TestMain.cpp rename to paddle/testing/TestMain.cpp diff --git a/paddle/utils/CMakeLists.txt b/paddle/utils/CMakeLists.txt index cf5a833014e744dfaaef1c6099c7906a52dff9dd..45240b5002aa18be4a9b7e3ec3b754eb83ca0e09 100644 --- a/paddle/utils/CMakeLists.txt +++ b/paddle/utils/CMakeLists.txt @@ -5,8 +5,6 @@ file(GLOB UTIL_SOURCES . *.cpp) create_resources(enable_virtualenv.py enable_virtualenv.c) set(UTIL_RES enable_virtualenv.c) -add_library(paddle_test_main STATIC TestMain.cpp) - if(APPLE) file(GLOB UTIL_ARCH_SOURCES . arch/osx/*.cpp) else()