diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b67fafd..fbd6d860 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,6 +312,8 @@ else() set(ALSA_LIBRARIES "") set(UDEV_INCLUDE_DIRS "") set(UDEV_LIBRARIES "") + # Version 1.7 supports CM108/CM119 GPIO PTT for Windows. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CM108") set(PORTAUDIO_INCLUDE_DIRS "") set(PORTAUDIO_LIBRARIES "") endif() diff --git a/src/direwolf.h b/src/direwolf.h index 41a7909d..ac6b1161 100644 --- a/src/direwolf.h +++ b/src/direwolf.h @@ -37,13 +37,6 @@ #endif -// Version 1.7 supports CM108/CM119 GPIO PTT for Windows. -// Define it here so we don't need to have separate Windows -// check in all the places that test this. -#if __WIN32__ -#define USE_CM108 1 -#endif - /* * Previously, we could handle only a single audio device. * This meant we could have only two radio channels. diff --git a/src/ptt.c b/src/ptt.c index 2a943006..f6956572 100644 --- a/src/ptt.c +++ b/src/ptt.c @@ -162,15 +162,15 @@ #include #endif -#ifdef USE_CM108 -#include "cm108.h" -#endif - /* So we can have more common code for fd. */ typedef int HANDLE; #define INVALID_HANDLE_VALUE (-1) -#endif +#endif /* __WIN32__ */ + +#ifdef USE_CM108 +#include "cm108.h" +#endif /* USE_CM108 */ #include "textcolor.h" #include "audio.h"