Fix Carotene compilation with XCode
authorMaksim Shabunin <maksim.shabunin@gmail.com>
Wed, 29 Jul 2020 22:03:55 +0000 (01:03 +0300)
committerMaksim Shabunin <maksim.shabunin@gmail.com>
Thu, 30 Jul 2020 19:52:29 +0000 (22:52 +0300)
3rdparty/carotene/CMakeLists.txt
3rdparty/carotene/hal/CMakeLists.txt
3rdparty/carotene/hal/dummy.cpp [new file with mode: 0644]
3rdparty/carotene/src/dummy.cpp [new file with mode: 0644]

index 528fcf62e15bbf0c22c43128d67618732a524b7e..43198157083dd26acad292b2f31f0abddc0d1ef0 100644 (file)
@@ -40,4 +40,5 @@ if(WITH_NEON)
     target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
 endif()
 
-add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
+# we add dummy file to fix XCode build
+add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>" "${CAROTENE_SOURCE_DIR}/dummy.cpp")
index a87f7a09498f0e1cec94ccbce811e607dc2a4c67..0162aae101e482290287e189e0ab56f2cd371662 100644 (file)
@@ -80,7 +80,8 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
 #    set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
   endif()
 
-add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
+# we add dummy file to fix XCode build
+add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs> "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 (file)
index 0000000..7f10ff3
--- /dev/null
@@ -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 (file)
index 0000000..7f10ff3
--- /dev/null
@@ -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