Files
lanthing-pc/cmake/code_analysis.cmake
Zhennan Tu fee9fae641 Support macOS (partial) (#240)
* macOS build 1

* macOS build 2

* macOS build 3

* macOS build 4

* macOS build 5

* macOS build 6

* macOS build 7

* Merge lanthing-app and lanthing

* macOS build 9

* macOS build 10

* macOS build 11

* macOS build 12

* macOS build 13

* macOS build 14

* macOS build 15

* Delete video2

* fix linux build

* fix linux build
2024-07-21 16:26:24 +08:00

12 lines
623 B
CMake
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function(set_code_analysis target enable)
if (LT_WINDOWS)
#c4251这个警告跟dll导出有关如果整个项目的编译平台、编译工具链、运行时都是一样的理论上不会有问题
if (${enable})
message(STATUS "${target} enable code analysis")
target_compile_options(${target} PRIVATE /W4 /WX /wd4819 /wd4251 /wd6326 /wd4702 /external:W0 /external:I ${CMAKE_CURRENT_SOURCE_DIR}/third_party /analyze:external-)
endif()
else()
target_compile_options(${target} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-unknown-warning-option -Wno-unused-private-field -Wno-newline-eof -Wno-unknown-pragmas)
endif()
endfunction()