Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for compiling with clang-cl #286

Merged
merged 1 commit into from Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/all_features/CMakeLists.txt
Expand Up @@ -90,7 +90,9 @@ if(MSVC)
target_compile_options(disabled PRIVATE /wd4505) # unreferenced local function has been removed
target_compile_options(disabled PRIVATE /wd4100) # unreferenced formal parameter
target_compile_options(disabled PRIVATE /wd4189) # local variable is initialized but not referenced
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(disabled PRIVATE -Wno-unknown-warning-option)
target_compile_options(disabled PRIVATE -Wno-unneeded-internal-declaration)
target_compile_options(disabled PRIVATE -Wno-unused-function)
Expand Down
10 changes: 7 additions & 3 deletions scripts/cmake/common.cmake
Expand Up @@ -72,10 +72,14 @@ endmacro()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compiler_flags(-Werror)
add_compiler_flags(-pedantic)
add_compiler_flags(-pedantic-errors)
add_compiler_flags(-fvisibility=hidden)
add_compiler_flags(-fstrict-aliasing)

# The following options are not valid when clang-cl is used.
if(NOT MSVC)
add_compiler_flags(-pedantic)
add_compiler_flags(-pedantic-errors)
add_compiler_flags(-fvisibility=hidden)
endif()
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Expand Down