Fixed macOS compilation (#5283)

* Fixed macOS compilation

* Added -Wno-undef
This commit is contained in:
Ilya Churaev 2021-04-19 10:24:26 +03:00 committed by GitHub
parent 211c5773fc
commit b751683c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,9 +66,9 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-error=attributes)
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND Python_VERSION VERSION_GREATER_EQUAL "3.9")
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND Python_VERSION VERSION_GREATER_EQUAL "3.9")
# for proper fix need to update pybind to version which does not use PyEval_InitThreads()
add_compile_options(-Wno-deprecated-declarations)
add_compile_options(-Wno-deprecated-declarations -Wno-undef)
endif()
# create target