diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index e0399743..aef48ed0 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit e03997435ad388a7c169de7a4b17b76d773ab69b +Subproject commit aef48ed0ec6989edbc2e9667d3ac0ffa9c023fbc diff --git a/CMakeLists.txt b/CMakeLists.txt index f70d271c..f956b4a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,24 +93,34 @@ if (FAAC_FOUND AND ENABLE_FAAC) list(APPEND LINK_LIB_LIST ${FAAC_LIBRARIES}) endif () + #添加库 add_library(zltoolkit STATIC ${ToolKit_src_list}) add_library(zlmediakit STATIC ${MediaKit_src_list}) + +set(VS_FALGS "/wd4819 /wd4996 /wd4018 /wd4267 /wd4244 /wd4101 /wd4828 /wd4309 /wd4573 /utf-8" ) #libmpeg if(ENABLE_HLS) aux_source_directory(${MediaServer_Root}/libmpeg/include src_mpeg) aux_source_directory(${MediaServer_Root}/libmpeg/source src_mpeg) include_directories(${MediaServer_Root}/libmpeg/include) add_library(mpeg STATIC ${src_mpeg}) + if(WIN32) + set_target_properties(mpeg PROPERTIES COMPILE_FLAGS ${VS_FALGS} ) + endif(WIN32) endif() if (WIN32) list(APPEND LINK_LIB_LIST WS2_32 Iphlpapi shlwapi) + set_target_properties(zltoolkit PROPERTIES COMPILE_FLAGS ${VS_FALGS} ) + set_target_properties(zlmediakit PROPERTIES COMPILE_FLAGS ${VS_FALGS} ) elseif(NOT ANDROID OR IOS) list(APPEND LINK_LIB_LIST pthread) endif () + + #测试程序 add_subdirectory(tests) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 176fa6ac..ff4be2bd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -36,6 +36,11 @@ foreach(TEST_SRC ${TEST_SRC_LIST}) STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" TEST_EXE_NAME ${TEST_SRC}) message(STATUS "add test:${TEST_EXE_NAME}") add_executable(${TEST_EXE_NAME} ${TEST_SRC}) + + if(WIN32) + set_target_properties(${TEST_EXE_NAME} PROPERTIES COMPILE_FLAGS ${VS_FALGS} ) + endif(WIN32) + target_link_libraries(${TEST_EXE_NAME} ${LINK_LIB_LIST}) endforeach()