mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
fix: set /Zc:__cplusplus
and /MP
to MSVC only (#3139)
1. macro `__cplusplus` is enabled by clang-cl 2. `/MP` is not supported by clang-cl (warning `-Wunused-command-line-argument` will be generated)
This commit is contained in:
parent
885b5473e2
commit
5ebfc92730
@ -34,7 +34,7 @@ elseif(NOT CMAKE_CXX_STANDARD)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# make sure __cplusplus is defined when using msvc and enable parallel build
|
# make sure __cplusplus is defined when using msvc and enable parallel build
|
||||||
if(MSVC)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /MP")
|
string(APPEND CMAKE_CXX_FLAGS " /Zc:__cplusplus /MP")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ if(SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS)
|
|||||||
endif()
|
endif()
|
||||||
add_library(spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS})
|
add_library(spdlog SHARED ${SPDLOG_SRCS} ${SPDLOG_ALL_HEADERS})
|
||||||
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
|
target_compile_definitions(spdlog PUBLIC SPDLOG_SHARED_LIB)
|
||||||
if(MSVC)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
target_compile_options(spdlog PUBLIC $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
|
target_compile_options(spdlog PUBLIC $<$<AND:$<CXX_COMPILER_ID:MSVC>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:/wd4251
|
||||||
/wd4275>)
|
/wd4275>)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user