Browse Source

Make addition of CAPI_STDCALL as definition per target.

Hanseul Jun 4 years ago
parent
commit
c31e1bf0be
1 changed files with 5 additions and 5 deletions
  1. 5 5
      CMakeLists.txt

+ 5 - 5
CMakeLists.txt

@@ -13,11 +13,6 @@ option(NO_TESTS "Disable tests build" OFF)
 option(WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
 option(CAPI_STDCALL "Set calling convention of C API callbacks stdcall" OFF)
 
-message("CAPI_STDCALL: ${CAPI_STDCALL}")
-if(CAPI_STDCALL)
-	add_definitions(-DCAPI_STDCALL)
-endif()
-
 if(USE_NICE)
 	option(USE_JUICE "Use libjuice" OFF)
 else()
@@ -223,6 +218,11 @@ else()
 	target_link_libraries(datachannel-static PRIVATE LibJuice::LibJuiceStatic)
 endif()
 
+if(CAPI_STDCALL)
+	target_compile_definitions(datachannel PUBLIC CAPI_STDCALL)
+	target_compile_definitions(datachannel-static PUBLIC CAPI_STDCALL)
+endif()
+
 add_library(LibDataChannel::LibDataChannel ALIAS datachannel)
 add_library(LibDataChannel::LibDataChannelStatic ALIAS datachannel-static)