Skip to content

Commit

Permalink
[ci] Improve checks for BSD and Windows Store builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Sep 24, 2023
1 parent c74a0a5 commit 7d00b62
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ project(libremidi
include(CMakeDependentOption)
include(CheckSymbolExists)
include(CheckCXXSourceCompiles)
include(CheckIncludeFile)

option(LIBREMIDI_HEADER_ONLY "Header-only mode" OFF)

Expand Down Expand Up @@ -222,6 +223,10 @@ elseif(APPLE)

elseif(WIN32)
## WinMM support ##
if(${CMAKE_SYSTEM_NAME} MATCHES WindowsStore)
set(LIBREMIDI_NO_WINMM 1)
endif()

if(NOT LIBREMIDI_NO_WINMM)
message(STATUS "libremidi: using WinMM")
target_compile_definitions(libremidi
Expand Down Expand Up @@ -258,7 +263,10 @@ elseif(UNIX AND NOT APPLE)
## ALSA support ##
if(NOT LIBREMIDI_NO_ALSA)
find_package(ALSA)
if(ALSA_FOUND)
check_include_file("<sys/eventfd.h>" LIBREMIDI_HAS_EVENTFD)
check_include_file("<sys/timerfd.h>" LIBREMIDI_HAS_TIMERFD)

if(ALSA_FOUND AND LIBREMIDI_HAS_EVENTFD AND LIBREMIDI_HAS_TIMERFD)
message(STATUS "libremidi: using ALSA")
target_compile_definitions(libremidi ${_public} LIBREMIDI_ALSA)
target_link_libraries(libremidi ${_public} ${ALSA_LIBRARIES})
Expand Down

0 comments on commit 7d00b62

Please sign in to comment.