Skip to content

Commit 7101f9b

Browse files
committed
build: clean up hidapi settings
1 parent 2cbd42f commit 7101f9b

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ endif()
153153

154154
option(FORTIFY "Define -D_FORTIFY_SOURCE=2 to check for programming errors" OFF)
155155

156-
if(MINGW AND (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.3.0))
157-
option(SC_HIDAPI "Build with HID support" OFF)
158-
else()
159-
option(SC_HIDAPI "Build with HID support" ON)
160-
endif()
156+
option(SC_HIDAPI "Build with HID support" ON)
161157

162158
option(SC_ABLETON_LINK "Build with Ableton Link support" ON)
163159

external_libraries/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ set( EXAMPLE_OSC OFF )
155155
if(SC_HIDAPI)
156156
add_subdirectory(hidapi)
157157
message(STATUS "Building with HID support")
158-
elseif(MINGW AND (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.3.0))
159-
message(WARNING "SC is by default built without HID-support if a MinGW/gcc-version below 5.3 is used. Please consult the Readme on how to enable it (easy).")
160158
else()
161159
message(STATUS "HID support disabled")
162160
endif()

lang/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if(SC_HIDAPI)
167167
${CMAKE_SOURCE_DIR}/external_libraries/hidapi/hidapi
168168
${CMAKE_SOURCE_DIR}/external_libraries/hidapi/hidapi_parser
169169
)
170-
add_definitions(-DSC_HIDAPI)
170+
add_compile_definitions(SC_HIDAPI)
171171
endif(SC_HIDAPI)
172172

173173
if(SC_QT OR SC_IDE)
@@ -223,6 +223,9 @@ endif()
223223
if(SC_HIDAPI)
224224
target_compile_definitions(libsclang PRIVATE HAVE_HIDAPI)
225225
target_link_libraries( libsclang hidapi hidapi_parser )
226+
if(WIN32)
227+
target_link_libraries(libsclang hid)
228+
endif()
226229

227230
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND HID_HIDRAW)
228231
target_link_libraries( libsclang ${UDEV_LIBRARIES})
@@ -321,9 +324,7 @@ if (FFTW3F_FOUND)
321324
target_link_libraries(libsclang ${FFTW3F_LIBRARY})
322325
endif()
323326

324-
if (WIN32 AND SC_HIDAPI)
325-
target_link_libraries(libsclang wsock32 ws2_32 portmidi iphlpapi hid)
326-
elseif(WIN32)
327+
if (WIN32)
327328
target_link_libraries(libsclang wsock32 ws2_32 portmidi iphlpapi)
328329
endif()
329330

0 commit comments

Comments
 (0)