Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
本补丁是对 #376 的一个补充(考虑到 #376 在增加了动态库 install 的同时,未保留原来的静态库 install)。
将 CMake 最小版本需求从 2.6 升到了 2.8.12,以消除构建过程中的 deprecation warning;
新增三个选项,以给用户对构建过程更多控制:
对于 KCP_BUILD_INSTALL、KCP_BUILD_TESTS:
完善 Windows 平台动态库构建支持;
在 Windows 平台上生成动态库要么需要通过 __declspec(dllexport) 来修饰要导出的函数符号,要么需要通过一个 DEF 文件 来声明所有要导出的符号。使用前一种方案可能需要在 ikcp.h 中加一段宏定义,所以我这里选择了使用一个 DEF 文件来声明所有要导出的符号。
完善 Windows 平台动态库的 install;
本补丁与 #376 不兼容的部分:
可以进一步完善的地方:
目前,我是直接在 CMakeLists.txt 里将导出的符号信息写入到一个临时的 exports.def 中的。如果用户不使用 CMake(比如:用户用 nmake),为了给予其方便,可考虑将 exports.def 提交到代码库里。