Skip to content

Commit 2f75188

Browse files
committed
Build: add support to build UT without OpenMP.
1 parent 5421690 commit 2f75188

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if(CMAKE_CUDA_COMPILER)
7171
endif()
7272
else()
7373
if(NOT USE_CUDA AND NOT USE_CUSOLVER_LCAO)
74-
message(WARNING "CUDA components detected, but both USE_CUDA and USE_CUSOLVER_LCAO set to OFF. NOT building CUDA version of ABACUS.")
74+
message(STATUS "CUDA components detected, but both USE_CUDA and USE_CUSOLVER_LCAO set to OFF. NOT building CUDA version of ABACUS.")
7575
elseif (USE_CUDA AND USE_CUSOLVER_LCAO)
7676
message(FATAL_ERROR "USE_CUDA and USE_CUSOLVER_LCAO set, but now they not allowed to coexist.")
7777
endif()
@@ -271,7 +271,10 @@ IF (BUILD_TESTING)
271271
add_executable(${UT_TARGET} ${UT_SOURCES})
272272
#dependencies & link library
273273
target_link_libraries(${UT_TARGET} ${UT_LIBS}
274-
OpenMP::OpenMP_CXX Threads::Threads GTest::gtest_main GTest::gmock_main)
274+
Threads::Threads GTest::gtest_main GTest::gmock_main)
275+
if(USE_OPENMP)
276+
target_link_libraries(${UT_TARGET} OpenMP::OpenMP_CXX)
277+
endif()
275278
install(TARGETS ${UT_TARGET} DESTINATION ${CMAKE_BINARY_DIR}/tests )
276279
add_test(NAME ${UT_TARGET}
277280
COMMAND ${UT_TARGET}

0 commit comments

Comments
 (0)