diff --git a/3rdpart/CMakeLists.txt b/3rdpart/CMakeLists.txt index 9614ec48..c12316fd 100644 --- a/3rdpart/CMakeLists.txt +++ b/3rdpart/CMakeLists.txt @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 39863dc9..c6f1a445 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) - # TODO: /wd4819 应该是不会生效 - set(COMPILE_OPTIONS_DEFAULT "/wd4566;/wd4819") + set(COMPILE_OPTIONS_DEFAULT + # TODO: /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 依赖