CMakeLists.txt 1.5 KB
Newer Older
1 2 3
set(PYTHON_TESTS_DIR
    ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests
    CACHE INTERNAL "python tests directory")
4 5 6 7

add_subdirectory(utils)
add_subdirectory(scripts)
add_subdirectory(testing)
8
add_subdirectory(phi)
T
Tao Luo 已提交
9
add_subdirectory(fluid)
10

11
add_subdirectory(ir)
12
add_subdirectory(pass)
13

14 15 16 17 18 19 20
# NOTE(zhiqiu): The changes of cc tests
# Before, (1) the source file of cc tests are distributed in different sub-directories,
# (2) the tests are added and configured by calling `cc_test()` in each `CMakeLists.txt`,
# (3) the tests links static libraries of paddle modules,
# (4) the tests binaries are generated in different directories, as the same as the
# folder of source file.

C
co63oc 已提交
21
# Now, we want to make all cc tests dynamically linked to the main paddle library,
22 23 24 25 26 27 28 29
# i.e., `libpaddle.so`, so we changes the logic of (2), (3), (4):
# (2) calling `cc_test()` in each `CMakeLists.txt` will not `exactly` add test, but
# record all tests and its source files, the action of add tests is defered to HERE.
# Why doing so? since the target of `libpaddle.so` is mostly the last target, and
# the tests should be added after that accroding to dependency.
# (3) the tests links dynamic libraries, `libpaddle.so`
# (4) the tests are generated to the same directory, i.e., `CC_TESTS_DIR` defined above.

C
co63oc 已提交
30
# Next, (to be discussed)
31
# (1) move all source files to same folder,
S
Shuangchi He 已提交
32
# (2) naturally, and configure tests in only one `CMakeLists.txt`,
33 34
# (3) cc tests support linking pre-built dynamic libraries. For example, use the dynamic
# library in the installed paddle by `pip`.