Skip to content

Commit

Permalink
Fix: compilation Issue on ARM64 (msys2 clangarm)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thiru31 committed Jun 30, 2024
1 parent be00247 commit ce1d840
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 3rdparty/carotene/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")

0 comments on commit ce1d840

Please sign in to comment.