summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Tomlinson <themarcustomlinson@gmail.com>2019-02-24 17:58:43 +0000
committerMarcus Tomlinson <themarcustomlinson@gmail.com>2019-02-24 17:58:43 +0000
commit03599c1281835f886e98da7d15244075ec88913f (patch)
tree56bcc4e6ecf725bc6e1c251e4787d185b2424533
parent70250813b7619de9f702b1106ea086941a5ba153 (diff)
Check for '#if defined( WIN32 )' in test apps
-rw-r--r--CMakeLists.txt11
-rw-r--r--tests/playraw.cpp2
-rw-r--r--tests/playsaw.cpp2
-rw-r--r--tests/record.cpp2
-rw-r--r--tests/teststops.cpp2
5 files changed, 12 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19d2c54..9ee491d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
diff --git a/tests/playraw.cpp b/tests/playraw.cpp
index f11f83c..0216f4a 100644
--- a/tests/playraw.cpp
+++ b/tests/playraw.cpp
@@ -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
diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp
index d1953b6..1f7bd52 100644
--- a/tests/playsaw.cpp
+++ b/tests/playsaw.cpp
@@ -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
diff --git a/tests/record.cpp b/tests/record.cpp
index 0e48f77..faa9789 100644
--- a/tests/record.cpp
+++ b/tests/record.cpp
@@ -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
diff --git a/tests/teststops.cpp b/tests/teststops.cpp
index 6159b88..0b85b48 100644
--- a/tests/teststops.cpp
+++ b/tests/teststops.cpp
@@ -21,7 +21,7 @@
#define REPETITIONS 10
// 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