From 866468cc3e49ce27100df5b70039f3182dac1f9f Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 30 Jul 2020 01:03:55 +0300 Subject: [PATCH] Fix Carotene compilation with XCode --- 3rdparty/carotene/CMakeLists.txt | 3 ++- 3rdparty/carotene/hal/CMakeLists.txt | 3 ++- 3rdparty/carotene/hal/dummy.cpp | 2 ++ 3rdparty/carotene/src/dummy.cpp | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 3rdparty/carotene/hal/dummy.cpp create mode 100644 3rdparty/carotene/src/dummy.cpp diff --git a/3rdparty/carotene/CMakeLists.txt b/3rdparty/carotene/CMakeLists.txt index 528fcf62e1..4319815708 100644 --- a/3rdparty/carotene/CMakeLists.txt +++ b/3rdparty/carotene/CMakeLists.txt @@ -40,4 +40,5 @@ if(WITH_NEON) target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON") endif() -add_library(carotene STATIC EXCLUDE_FROM_ALL "$") +# we add dummy file to fix XCode build +add_library(carotene STATIC EXCLUDE_FROM_ALL "$" "${CAROTENE_SOURCE_DIR}/dummy.cpp") diff --git a/3rdparty/carotene/hal/CMakeLists.txt b/3rdparty/carotene/hal/CMakeLists.txt index a87f7a0949..0162aae101 100644 --- a/3rdparty/carotene/hal/CMakeLists.txt +++ b/3rdparty/carotene/hal/CMakeLists.txt @@ -80,7 +80,8 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs}) # set_source_files_properties(impl.cpp $ COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000") endif() -add_library(tegra_hal STATIC $) +# we add dummy file to fix XCode build +add_library(tegra_hal STATIC $ "dummy.cpp") set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}) set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}") if(NOT BUILD_SHARED_LIBS) diff --git a/3rdparty/carotene/hal/dummy.cpp b/3rdparty/carotene/hal/dummy.cpp new file mode 100644 index 0000000000..7f10ff3e8c --- /dev/null +++ b/3rdparty/carotene/hal/dummy.cpp @@ -0,0 +1,2 @@ +// This file is needed for compilation on some platforms e.g. with XCode generator +// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457 diff --git a/3rdparty/carotene/src/dummy.cpp b/3rdparty/carotene/src/dummy.cpp new file mode 100644 index 0000000000..7f10ff3e8c --- /dev/null +++ b/3rdparty/carotene/src/dummy.cpp @@ -0,0 +1,2 @@ +// This file is needed for compilation on some platforms e.g. with XCode generator +// Related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17457