From ce1d840adfe68504fd9b35f1568286e1911599c9 Mon Sep 17 00:00:00 2001 From: Thirumalai Nagalingam <81082960+thiru31@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:58:48 +0530 Subject: [PATCH] Fix: compilation Issue on ARM64 (msys2 clangarm) Added a definition for M_PI in the code to resolve a compilation error encountered when building OpenCV on the MSYS2 environment. The M_PI constant was not defined, causing the compilation to fail. --- 3rdparty/carotene/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3rdparty/carotene/CMakeLists.txt b/3rdparty/carotene/CMakeLists.txt index aa95956e7f..dc780fd645 100644 --- a/3rdparty/carotene/CMakeLists.txt +++ b/3rdparty/carotene/CMakeLists.txt @@ -52,5 +52,9 @@ if(WITH_NEON) endif() endif() + if(MINGW) + target_compile_definitions(carotene_objs PRIVATE "-D_USE_MATH_DEFINES=1") + endif() + # we add dummy file to fix XCode build add_library(carotene STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} "$" "${CAROTENE_SOURCE_DIR}/dummy.cpp")