Fix CMake VS build
authorMarcus Tomlinson <themarcustomlinson@gmail.com>
Sun, 24 Feb 2019 15:18:51 +0000 (15:18 +0000)
committerMarcus Tomlinson <themarcustomlinson@gmail.com>
Sun, 24 Feb 2019 15:18:51 +0000 (15:18 +0000)
CMakeLists.txt

index 89b537279f668cbdc24c71ab211666087f8b6666..19d2c544f563e1fc04df3e38bc1b8cc64ac1b2de 100644 (file)
@@ -25,7 +25,6 @@ endif()
 
 # Necessary for Windows
 if(WIN32)
-  set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
   set(CMAKE_DEBUG_POSTFIX "d")
 endif()
 
@@ -197,6 +196,9 @@ 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)
@@ -216,7 +218,6 @@ 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})
@@ -237,9 +238,6 @@ 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()