From a08d38538efbc70e79ce138ce4ed31b982b5ce42 Mon Sep 17 00:00:00 2001 From: Mourad Gouicem Date: Tue, 5 Oct 2021 01:36:20 -0700 Subject: [PATCH] build: test: link to libm appropriately --- tests/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 490d95fe380..2f610ffbcf6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -63,7 +63,10 @@ append(CMAKE_CXX_FLAGS "${CMAKE_TEST_CCXX_NOWARN_FLAGS}") append_host_compiler_options(CMAKE_CXX_FLAGS "${DPCPP_CXX_NOWARN_FLAGS}") if(NOT DNNL_CPU_RUNTIME STREQUAL "NONE") - register_exe(api-c api.c "test") + if(NOT WIN32) + find_library(LIBM m REQUIRED) + endif() + register_exe(api-c api.c "test" "${LIBM}") endif() if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND (UNIX OR MINGW))