make sure we compile and link against mpi_stubs when BUILD_MPI is disabled

This commit is contained in:
Axel Kohlmeyer
2020-05-27 13:35:07 -04:00
parent bb57e90a27
commit 9142d4893d

View File

@ -8,7 +8,12 @@ endif()
set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests) set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp) add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp)
target_compile_definitions(style_tests PRIVATE TEST_INPUT_FOLDER=${TEST_INPUT_FOLDER}) target_compile_definitions(style_tests PRIVATE TEST_INPUT_FOLDER=${TEST_INPUT_FOLDER})
target_link_libraries(style_tests PUBLIC GTest::GTest GTest::GMock MPI::MPI_CXX Yaml::Yaml) target_link_libraries(style_tests PUBLIC GTest::GTest GTest::GMock Yaml::Yaml)
if(BUILD_MPI)
target_link_libraries(style_tests PUBLIC MPI::MPI_CXX)
else()
target_link_libraries(style_tests PUBLIC mpi_stubs)
endif()
# pair style tester # pair style tester
add_executable(pair_style pair_style.cpp) add_executable(pair_style pair_style.cpp)