mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 12:11:36 +08:00
修正 Windows 编译问题
This commit is contained in:
parent
310b60276c
commit
8cb73e1bc3
@ -158,7 +158,7 @@ endif()
|
||||
add_library(zltoolkit STATIC ${ToolKit_SRC_LIST})
|
||||
add_library(ZLMediaKit::ToolKit ALIAS zltoolkit)
|
||||
target_compile_definitions(zltoolkit
|
||||
PRIVATE ${COMPILE_DEFINITIONS})
|
||||
PUBLIC ${COMPILE_DEFINITIONS})
|
||||
target_compile_options(zltoolkit
|
||||
PRIVATE ${COMPILE_OPTIONS_DEFAULT})
|
||||
target_include_directories(zltoolkit
|
||||
|
@ -66,7 +66,8 @@ message(STATUS "编译类型: ${CMAKE_BUILD_TYPE}")
|
||||
# 方便排查编译问题, 需要 FORCE CACHE, 否则需要命令行设置才生效
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON CACHE INTERNAL "" FORCE)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
# TODO: include 当前目录会导致 server 编译出错, 待排除
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
|
||||
|
||||
# 安装路径
|
||||
if(NOT CMAKE_INSTALL_PREFIX)
|
||||
@ -170,8 +171,16 @@ if(UNIX)
|
||||
"-Wno-unused-function;-Wno-unused-parameter;-Wno-unused-variable"
|
||||
"-Wno-error=extra;-Wno-error=missing-field-initializers;-Wno-error=type-limits")
|
||||
elseif(WIN32)
|
||||
set(COMPILE_OPTIONS_DEFAULT
|
||||
# TODO: /wd4819 应该是不会生效
|
||||
set(COMPILE_OPTIONS_DEFAULT "/wd4566;/wd4819")
|
||||
"/wd4566;/wd4819"
|
||||
# warning C4530: C++ exception handler used, but unwind semantics are not enabled.
|
||||
"/EHsc")
|
||||
if (MSVC)
|
||||
# disable Windows logo
|
||||
list(APPEND COMPILE_OPTIONS_DEFAULT "/nologo")
|
||||
list(APPEND CMAKE_STATIC_LINKER_FLAGS "/nologo")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# mediakit 以及各个 runtime 依赖
|
||||
|
Loading…
Reference in New Issue
Block a user