39 lines
1.1 KiB
CMake
39 lines
1.1 KiB
CMake
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
message(STATUS "Building tests with Clang")
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
message(STATUS "Building tests with GCC; modules support is experimental")
|
|
else()
|
|
message(WARNING "Unsupported compiler for test modules: ${CMAKE_CXX_COMPILER_ID}. Build may fail.")
|
|
endif()
|
|
|
|
if(WIN32)
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib" ".dll.a")
|
|
else()
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so")
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_ast/CMakeLists.txt)
|
|
add_subdirectory(test_ast)
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_lsp_any/CMakeLists.txt)
|
|
add_subdirectory(test_lsp_any)
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_symbol/CMakeLists.txt)
|
|
add_subdirectory(test_symbol)
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_scheduler/CMakeLists.txt)
|
|
add_subdirectory(test_scheduler)
|
|
endif()
|
|
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_semantic/CMakeLists.txt)
|
|
add_subdirectory(test_semantic)
|
|
endif()
|
|
|
|
# test_module 由顶层 add_subdirectory(test) 自动拉入,无需单独处理
|
|
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test_module/CMakeLists.txt)
|
|
add_subdirectory(test_module)
|
|
endif()
|