Skip to content

Commit

Permalink
Change cmake variable HIDAPI to avoid polluting the submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
bagong committed Feb 7, 2017
1 parent cfb03f2 commit 0192b2e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ option(SYSTEM_YAMLCPP "Use yaml-cpp library from system" OFF)
option(FORTIFY "Define -D_FORTIFY_SOURCE=2 to check for programming errors" OFF)

if(MINGW AND (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.3.0))
option(HIDAPI "Build with HID support" OFF)
option(SC_HIDAPI "Build with HID support" OFF)
else()
option(HIDAPI "Build with HID support" ON)
option(SC_HIDAPI "Build with HID support" ON)
endif()

#############################################
Expand Down
10 changes: 5 additions & 5 deletions README_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ built in MinGW-based environments. Use VS, if you need WASAPI.

### HIDAPI

Currently HIDAPI is disabled by default for MinGW builds using MinGW/GCC
versions below 5.3. It can be enabled easily though:
Currently HIDAPI is disabled by default for MinGW builds using MinGW/GCC
versions below 5.3. It can be enabled easily though:

- Go to `SC-source/external-libraries/hidapi/hidapi_parser/hidapi_parser.c`.

Expand All @@ -755,10 +755,10 @@ Uncomment:

Rerun the cmake configuration step and add the argument:

-D HIDAPI=ON
-D SC_HIDAPI=ON

Now you can go on with the build, and it should succeed.


Walkthroughs
------------
Expand Down Expand Up @@ -824,7 +824,7 @@ you going:

pacman -S mingw-w64-{x86_64,i686}-portaudio mingw-w64-{i686,x86_64}-libsndfile mingw-w64-{i686,x86_64}-fftw

6. If you plan to build SuperNova, the sound server alternative that supports multiple processor-cores, install
6. If you plan to build SuperNova, the sound server alternative that supports multiple processor-cores, install
`dlfcn` (mingw-w64-x86_64-dlfcn) (Google is your friend). 64-bit SuperNova on Windows is almost yours!

If you are really lazy but read to the end before starting, i.e. smart, here are all the packages in a single go:
Expand Down
2 changes: 1 addition & 1 deletion external_libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ endif()
set( EXAMPLE_TEST OFF )
set( EXAMPLE_OSC OFF )

if(HIDAPI)
if(SC_HIDAPI)
add_subdirectory(hidapi)
message(STATUS "Building with HID support")
else()
Expand Down
6 changes: 4 additions & 2 deletions lang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ if(FALSE) # libsclang is a shared library
target_compile_definitions(libsclang INTERFACE BUILDING_SCLANG)
endif()

if(HIDAPI)
if(SC_HIDAPI)
target_compile_definitions(libsclang PRIVATE HAVE_HIDAPI)
target_link_libraries( libsclang hidapi hidapi_parser )
endif()
Expand Down Expand Up @@ -297,8 +297,10 @@ if (FFTW3F_FOUND)
target_link_libraries(libsclang ${FFTW3F_LIBRARY})
endif()

if (WIN32)
if (WIN32 AND SC_HIDAPI)
target_link_libraries(libsclang wsock32 ws2_32 portmidi iphlpapi hid)
elseif(WIN32)
target_link_libraries(libsclang wsock32 ws2_32 portmidi iphlpapi)
endif()

if (GC_SANITYCHECK)
Expand Down

0 comments on commit 0192b2e

Please sign in to comment.