From 3e3c6d479960b261334c80823d2a1b980bcba2f5 Mon Sep 17 00:00:00 2001 From: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:50:28 +0800 Subject: [PATCH] remove -fsized-deallocation when build with clang-cl. Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com> --- package-system/pybind11/Findpybind11.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package-system/pybind11/Findpybind11.cmake b/package-system/pybind11/Findpybind11.cmake index 23b61bf6..d8cdf1eb 100644 --- a/package-system/pybind11/Findpybind11.cmake +++ b/package-system/pybind11/Findpybind11.cmake @@ -17,7 +17,9 @@ add_library(${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL) ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${LIB_NAME}_INCLUDE_DIR}) -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if (MSVC) + target_compile_options(3rdParty::pybind11 INTERFACE /Zc:sizedDealloc) +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") target_compile_options(3rdParty::pybind11 INTERFACE -fsized-deallocation) endif()