diff --git a/CMakeLists.txt b/CMakeLists.txt index 729853eec605b9ad7baee163557699368f1c9103..21c5c6b9835a6cff8ad11853e97c9a484aa382a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,9 @@ target_link_libraries(${module_name} _aidge_core # _ is added because we link the exported target and not the project ) +# Add definition _USE_MATH_DEFINES to enable math constant definitions from math.h/cmath. +target_compile_definitions(${module_name} PRIVATE _USE_MATH_DEFINES) + #Set target properties set_property(TARGET ${module_name} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/include/aidge/backend/cpu/operator/HeavisideImpl_kernels.hpp b/include/aidge/backend/cpu/operator/HeavisideImpl_kernels.hpp index f397927a92bdc28215040663e68efaf9ef9ab1a2..92f12fbed5c6530a6c5b57e74d2b46446533ca02 100644 --- a/include/aidge/backend/cpu/operator/HeavisideImpl_kernels.hpp +++ b/include/aidge/backend/cpu/operator/HeavisideImpl_kernels.hpp @@ -15,7 +15,7 @@ #include "aidge/utils/Registrar.hpp" #include <cstddef> // std::size_t -#include <math.h> +#include <cmath> #include "aidge/backend/cpu/operator/HeavisideImpl.hpp" #include "aidge/utils/ErrorHandling.hpp"