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 21, 2024
1 parent 5e7ada4 commit 7708633
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 173 deletions.
33 changes: 27 additions & 6 deletions plugins/midi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,42 @@ if(NOT EXISTS "${LIBREMIDI_DIR}/CMakeLists.txt")
endif()
add_subdirectory("${LIBREMIDI_DIR}" "${LIBREMIDI_DIR}/build" EXCLUDE_FROM_ALL)

# --- End of section ---

add_library(${PROJECT_NAME} MODULE)

if(OS_WINDOWS)
if(MSVC)
target_compile_options(libremidi PUBLIC /wd4251 /wd4267 /wd4275)
target_compile_options(libremidi PRIVATE /wd4251 /wd4267 /wd4275 /wd4101
/wd4244 /wd4018)
target_compile_options(${PROJECT_NAME} PRIVATE /wd4101 /wd4244 /wd4018)
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
PUBLIC -Wno-error=conversion
-Wno-error=unused-result
-Wno-error=shadow
-Wno-error=unused-parameter
-Wno-error=unused-variable
-Wno-error=deprecated-declarations
-Wno-error=sign-compare)
endif()

# --- End of section ---

add_library(${PROJECT_NAME} MODULE)
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}
Expand Down
Loading

0 comments on commit 7708633

Please sign in to comment.