Check for '#if defined( WIN32 )' in test apps
authorMarcus Tomlinson <themarcustomlinson@gmail.com>
Sun, 24 Feb 2019 17:58:43 +0000 (17:58 +0000)
committerMarcus Tomlinson <themarcustomlinson@gmail.com>
Sun, 24 Feb 2019 17:58:43 +0000 (17:58 +0000)
CMakeLists.txt
tests/playraw.cpp
tests/playsaw.cpp
tests/record.cpp
tests/teststops.cpp

index 19d2c544f563e1fc04df3e38bc1b8cc64ac1b2de..9ee491d95953f299999b5f7eb970800c4e109018 100644 (file)
@@ -28,6 +28,10 @@ if(WIN32)
   set(CMAKE_DEBUG_POSTFIX "d")
 endif()
 
+if(MINGW)
+  set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
+endif()
+
 # Build Options
 option(BUILD_SHARED_LIBS "Compile library shared lib." TRUE)
 option(BUILD_STATIC_LIBS "Compile library static lib." TRUE)
@@ -196,9 +200,6 @@ if (NEED_PTHREAD)
   list(APPEND LINKLIBS Threads::Threads)
 endif()
 
-# Set compile-time definitions
-add_definitions(${API_DEFS})
-
 # Create library targets.
 cmake_policy(SET CMP0042 OLD)
 set(LIB_TARGETS)
@@ -218,6 +219,7 @@ if(BUILD_SHARED_LIBS)
     ${INCDIRS})
 
   # Set compile-time definitions
+  target_compile_definitions(rtaudio PRIVATE ${API_DEFS})
   target_compile_definitions(rtaudio PRIVATE RTAUDIO_EXPORT)
 
   target_link_libraries(rtaudio ${LINKLIBS})
@@ -238,6 +240,9 @@ if(BUILD_STATIC_LIBS)
     $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
     ${INCDIRS})
 
+  # Set compile-time definitions
+  target_compile_definitions(rtaudio_static PRIVATE ${API_DEFS})
+
   target_link_libraries(rtaudio_static ${LINKLIBS})
 endif()
 
index f11f83c28f4b90738ca72cba6773dd30f52234f6..0216f4af0216c201f9bdf6749324a35e9739cb0a 100644 (file)
@@ -44,7 +44,7 @@ typedef double  MY_TYPE;
 */
 
 // Platform-dependent sleep routines.
-#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ )
+#if defined( WIN32 )
   #include <windows.h>
   #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) 
 #else // Unix variants
index d1953b6ca164c0a14ffc3ef136b08d60f5072c26..1f7bd52c5fe389528796cf609a37893db220da9e 100644 (file)
@@ -41,7 +41,7 @@ typedef double MY_TYPE;
 */
 
 // Platform-dependent sleep routines.
-#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ )
+#if defined( WIN32 )
   #include <windows.h>
   #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) 
 #else // Unix variants
index 0e48f77e02dfe87e7cf521cb56837c3e61a7c441..faa9789a80ef11f87e5c828e138ae04d38bd7097 100644 (file)
@@ -38,7 +38,7 @@ typedef double MY_TYPE;
 */
 
 // Platform-dependent sleep routines.
-#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ )
+#if defined( WIN32 )
   #include <windows.h>
   #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) 
 #else // Unix variants
index 6159b88b00fb065c259cc58d948cb77b721d0a9f..0b85b48f4a8690da73c3a958a17346049378552e 100644 (file)
@@ -21,7 +21,7 @@
 #define REPETITIONS 10\r
 \r
 // Platform-dependent sleep routines.\r
-#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ )\r
+#if defined( WIN32 )\r
   #include <windows.h>\r
   #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) \r
 #else // Unix variants\r