diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a58498b..9948488b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ project(ZLMediaKit) -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.1.3) #使能c++11 -add_compile_options(-std=c++11) +set(CMAKE_CXX_STANDARD 11) #加载自定义模块 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") @@ -81,10 +81,10 @@ add_definitions(-DENABLE_RING_USEBUF) add_library(zltoolkit STATIC ${ToolKit_src_list}) add_library(zlmediakit STATIC ${MediaKit_src_list}) -if (NOT WIN32) - list(APPEND LINK_LIB_LIST pthread) -else() +if (WIN32) list(APPEND LINK_LIB_LIST WS2_32 Iphlpapi shlwapi) +elif(NOT ANDROID and NOT IOS) + list(APPEND LINK_LIB_LIST pthread) endif () message(STATUS "linked libraries:${LINK_LIB_LIST}") diff --git a/README.md b/README.md index 9c7862e9..7295c4d8 100644 --- a/README.md +++ b/README.md @@ -110,18 +110,14 @@ Windows | 已经完成移植 - 我的编译环境 - windows 10 - visual studio 2017 - - [ZLToolKit](https://github.com/xiongziliang/ZLToolKit) - [cmake-gui](https://cmake.org/files/v3.10/cmake-3.10.0-rc1-win32-x86.msi) - 编译 ``` -   1 请先编译安装ZLToolKit -   2 使用cmake-gui打开工程并生成vs工程文件(配置时可能需要指定ZLTookKit的路径). -   3 找到工程文件(ZLMediaKit.sln),双击用vs2017打开. -   4 选择编译Release 版本. -   5 依次编译 ZLMediaKit_static、ZLMediaKit_shared、ALL_BUILD、INSTALL. - 6 找到目标文件并运行测试用例. -   7 找到安装的头文件及库文件(在源码所在分区根目录). +   1 使用cmake-gui打开工程并生成vs工程文件. +   2 找到工程文件(ZLMediaKit.sln),双击用vs2017打开. +   3 选择编译Release 版本. + 4 找到目标文件并运行测试用例. ``` ## 使用方法 - 作为服务器: diff --git a/build_for_android.sh b/build_for_android.sh index e669cfe8..f6fca1b5 100755 --- a/build_for_android.sh +++ b/build_for_android.sh @@ -1,8 +1,6 @@ #!/bin/bash -path=`pwd` cd .. git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd $path cd ZLMediaKit git submodule init git submodule update diff --git a/build_for_ios.sh b/build_for_ios.sh index 3e58e8c9..c7bf929b 100755 --- a/build_for_ios.sh +++ b/build_for_ios.sh @@ -1,8 +1,6 @@ #!/bin/bash -path=`pwd` cd .. git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd $path cd ZLMediaKit git submodule init git submodule update diff --git a/build_for_linux.sh b/build_for_linux.sh index 0feb3f43..2a510c59 100755 --- a/build_for_linux.sh +++ b/build_for_linux.sh @@ -1,8 +1,6 @@ #!/bin/bash -path=`pwd` cd .. git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd $path cd ZLMediaKit git submodule init git submodule update diff --git a/build_for_mac.sh b/build_for_mac.sh index 8f5e0003..60828d2d 100755 --- a/build_for_mac.sh +++ b/build_for_mac.sh @@ -1,8 +1,6 @@ #!/bin/bash -path=`pwd` cd .. git clone --depth=1 https://github.com/xiongziliang/ZLMediaKit.git -cd $path cd ZLMediaKit git submodule init git submodule update