Skip to content

Commit

Permalink
Adapt to new libremidi version
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Feb 20, 2024
1 parent 5e7ada4 commit 1b0a554
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 179 deletions.
33 changes: 21 additions & 12 deletions plugins/midi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,31 @@ if(NOT EXISTS "${LIBREMIDI_DIR}/CMakeLists.txt")
endif()
add_subdirectory("${LIBREMIDI_DIR}" "${LIBREMIDI_DIR}/build" EXCLUDE_FROM_ALL)

if(OS_WINDOWS)
if(MSVC)
target_compile_options(libremidi PUBLIC /wd4251 /wd4267 /wd4275)
endif()
else()
target_compile_options(
libremidi
PUBLIC -Wno-error=conversion -Wno-error=unused-result -Wno-error=shadow
-Wno-error=unused-parameter -Wno-error=deprecated-declarations
-Wno-error=sign-compare)
endif()

# --- End of section ---

add_library(${PROJECT_NAME} MODULE)

if(MSVC)
target_compile_options(libremidi PRIVATE /wd4251 /wd4267 /wd4275 /wd4101
/wd4244 /wd4018)
target_compile_options(${PROJECT_NAME} PRIVATE /wd4101 /wd4244 /wd4018)
endif(MSVC)

if(OS_MACOS)
set(PATCH_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/remove-bit-cast-for-macos-build.patch")
execute_process(
COMMAND git apply ${PATCH_FILE}
WORKING_DIRECTORY ${LIBREMIDI_DIR}
RESULT_VARIABLE PATCH_RESULT)
if(PATCH_RESULT EQUAL 0)
message("Libremidi patch \"${PATCH_FILE}\" applied successfully!")
else()
message(
WARNING "Libremidi patch \"${PATCH_FILE}\" did NOT apply successfully!")
endif()
endif()

target_sources(
${PROJECT_NAME}
PRIVATE macro-condition-midi.cpp macro-condition-midi.hpp
Expand Down
Loading

0 comments on commit 1b0a554

Please sign in to comment.