void-packages/srcpkgs/libopenal/patches/cross.patch

36 lines
1.4 KiB
Diff

--- CMakeLists.txt
+++ CMakeLists.txt
@@ -1089,19 +1089,11 @@ ELSE()
SET(NATIVE_BIN_DIR "${OpenAL_BINARY_DIR}/native-tools")
FILE(MAKE_DIRECTORY "${NATIVE_BIN_DIR}")
- SET(BIN2H_COMMAND "${NATIVE_BIN_DIR}/bin2h")
- SET(BSINCGEN_COMMAND "${NATIVE_BIN_DIR}/bsincgen")
- ADD_CUSTOM_COMMAND(OUTPUT "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${NATIVE_SRC_DIR}"
- COMMAND ${CMAKE_COMMAND} -E remove "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
- COMMAND ${CMAKE_COMMAND} --build . --config "Release"
- WORKING_DIRECTORY "${NATIVE_BIN_DIR}"
- DEPENDS "${NATIVE_SRC_DIR}/CMakeLists.txt"
- IMPLICIT_DEPENDS
- C "${NATIVE_SRC_DIR}/bin2h.c"
- C "${NATIVE_SRC_DIR}/bsincgen.c"
- VERBATIM
- )
+ set(IMPORT_EXECUTABLES "native-tools/ImportNativeToools.cmake" CACHE FILEPATH "POINT")
+ INCLUDE(${IMPORT_EXECUTABLES})
+
+ SET(BIN2H_COMMAND bin2h)
+ SET(BSINCGEN_COMMAND bsincgen)
ENDIF()
ADD_CUSTOM_TARGET(native-tools
DEPENDS "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
--- native-tools/CMakeLists.txt
+++ native-tools/CMakeLists.txt
@@ -27,3 +27,5 @@ target_compile_definitions(bsincgen PRIVATE ${CPP_DEFS})
if(HAVE_LIBM)
target_link_libraries(bsincgen m)
endif(HAVE_LIBM)
+
+export(TARGETS bin2h bsincgen FILE ${CMAKE_BINARY_DIR}/ImportNativeToools.cmake)