From 4824354e4673a58d8620975ce98bb93d13cf7220 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Thu, 23 May 2024 17:14:01 +0300 Subject: [PATCH] Merge pull request #25631 from asmorkalov:as/png_build_fix Fixed CMake Missing variable is: CMAKE_ASM_COMPILE_OBJECT in PNG build #25631 Error message with `-DBUILD_PNG=ON` on ARM64: ``` -- Configuring done CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_ASM_COMPILE_OBJECT -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly. ``` ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake --- 3rdparty/libpng/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index a7701c9fed..d05031b9f5 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -3,11 +3,7 @@ # # ---------------------------------------------------------------------------- -if(ENABLE_NEON) - project(${PNG_LIBRARY} C ASM) -else() - project(${PNG_LIBRARY} C) -endif() +project(${PNG_LIBRARY} C) if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU AND NOT EMSCRIPTEN) find_library(M_LIBRARY m) @@ -59,6 +55,7 @@ if(TARGET_ARCH MATCHES "^(ARM|arm|aarch)") elseif(NOT PNG_ARM_NEON STREQUAL "off") list(APPEND lib_srcs arm/arm_init.c arm/filter_neon_intrinsics.c arm/palette_neon_intrinsics.c) if(NOT MSVC) + enable_language(ASM) list(APPEND lib_srcs arm/filter_neon.S) endif() if(PNG_ARM_NEON STREQUAL "on")