Cleanup compiler definition macro

master
Ryan Lee 2016-04-09 13:43:16 -07:00
parent 4272b2f899
commit 563c3badac
1 changed files with 10 additions and 17 deletions

View File

@ -83,8 +83,6 @@ find_package(RapidJson)
# Socket.Io-client-cpp, socket.io-client-cpp requires boost library # Socket.Io-client-cpp, socket.io-client-cpp requires boost library
find_package(SioClient) find_package(SioClient)
add_definitions(${WEBRTC_DEFINES})
# ============================================================================ # ============================================================================
# Generate the config.h that includes all the compilation settings. # Generate the config.h that includes all the compilation settings.
# ============================================================================ # ============================================================================
@ -136,6 +134,7 @@ if (TN_WITH_STATIC)
${HEADERS} ${HEADERS}
${SOURCES}) ${SOURCES})
list(APPEND TN_LIBRARIES throughnet) list(APPEND TN_LIBRARIES throughnet)
target_compile_definitions(throughnet PRIVATE ${WEBRTC_DEFINES})
target_include_directories(throughnet PRIVATE ${_TN_INCLUDE_DIR_INTERNAL} ) target_include_directories(throughnet PRIVATE ${_TN_INCLUDE_DIR_INTERNAL} )
if (WIN32) if (WIN32)
@ -152,6 +151,7 @@ if (TN_WITH_SHARED)
${HEADERS} ${HEADERS}
${SOURCES}) ${SOURCES})
list(APPEND TN_LIBRARIES throughnet_shared) list(APPEND TN_LIBRARIES throughnet_shared)
target_compile_definitions(throughnet_shared PRIVATE ${WEBRTC_DEFINES})
target_include_directories(throughnet_shared PRIVATE ${_TN_INCLUDE_DIR_INTERNAL} ) target_include_directories(throughnet_shared PRIVATE ${_TN_INCLUDE_DIR_INTERNAL} )
set_target_properties(throughnet_shared set_target_properties(throughnet_shared
@ -162,10 +162,10 @@ if (TN_WITH_SHARED)
target_link_libraries(throughnet_shared ${WEBRTC_LIBRARIES}) target_link_libraries(throughnet_shared ${WEBRTC_LIBRARIES})
if (WIN32) if (WIN32)
# Compile as DLL (export function declarations) # # Compile as DLL (export function declarations)
set_property( # set_property(
TARGET throughnet_shared # TARGET throughnet_shared
PROPERTY COMPILE_DEFINITIONS) # PROPERTY COMPILE_DEFINITIONS)
endif() endif()
if (APPLE) if (APPLE)
@ -199,17 +199,10 @@ endif()
# Test example # Test example
# ============================================================================ # ============================================================================
add_executable(test_main add_executable(test_main src/test/test_main.cc)
src/test/test_main.cc
)
target_include_directories(test_main PRIVATE target_compile_definitions(test_main PRIVATE ${WEBRTC_DEFINES})
${_TN_INCLUDE_DIR_INTERNAL} target_include_directories(test_main PRIVATE ${_TN_INCLUDE_DIR_INTERNAL})
) target_link_libraries(test_main throughnet ${WEBRTC_LIBRARIES})
target_link_libraries(test_main
throughnet
${WEBRTC_LIBRARIES}
)
add_test(test_main test_main) add_test(test_main test_main)