void-packages/srcpkgs/waifu2x-converter-cpp/patches/fix-cross.patch

30 lines
681 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b728b5..17d9dea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,14 @@ if (WIN32)
endif()
endif()
-add_executable(conv conv.c)
+add_custom_target("conv")
+add_custom_command(
+ OUTPUT "build/conv"
+ COMMAND cc
+ ARGS -o conv conv.c
+ DEPENDS "build/conv"
+ COMMENT "Generator"
+)
set(HAVE_OPENCV FALSE)
set(HAVE_OPENCV_3_X FALSE)
@@ -355,7 +362,7 @@ else()
target_link_libraries(w2xc ${OPENCV_LIBRARIES} ${CMAKE_DL_LIBS} pthread ${FILE_SYSTEM_LIB})
endif()
-set(CONV_EXE "$<TARGET_FILE_DIR:conv>/conv")
+set(CONV_EXE ${CMAKE_BINARY_DIR}/conv)
add_custom_command(
OUTPUT modelHandler_OpenCL.cl.h