From 31afba6b4415db8ed4a18a5393a9f5b8bc356bfc Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Mon, 31 Oct 2022 12:41:06 +0100 Subject: [PATCH] Define _USE_MATH_DEFINES for MSVC when alpaka is found --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1f4d51c71..19446ef27c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE "Release") endif() +if (MSVC) + # FIXME(bgruber): alpaka uses M_PI, so we need to make it available on MSVC. This may be fixed in alpaka 1.0.0. + target_compile_definitions(llama INTERFACE _USE_MATH_DEFINES) +endif() + # tests option(BUILD_TESTING "" OFF) include(CTest)