From 80c3baa196b25aabdfffb742151f875aa1dc7851 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 5 May 2022 16:09:51 +0200 Subject: [PATCH] /wd4503 is only for MSVC 2015 --- Installation/CMakeLists.txt | 2 -- Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index e050c6b9c2b..ef40543602e 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -390,8 +390,6 @@ if(MSVC) "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict") uniquely_add_flags(CGAL_CXX_FLAGS "/fp:except-") - uniquely_add_flags(CGAL_CXX_FLAGS "/wd4503" - )# Suppress warnings C4503 about "decorated name length exceeded" uniquely_add_flags(CGAL_CXX_FLAGS "/bigobj") # Use /bigobj by default if(RUNNING_CGAL_AUTO_TEST) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index f046f1e7e5b..d6ba4662ea3 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -121,9 +121,13 @@ function(CGAL_setup_CGAL_dependencies target) target_compile_options(${target} INTERFACE $<$:/fp:strict> $<$:/fp:except-> - $<$:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded" $<$:/bigobj> # Use /bigobj by default ) + if(MSVC_TOOLSET_VERSION VERSION_LESS_EQUAL 140) # for MSVC 2015 + target_compile_options(${target} INTERFACE + $<$:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded" + ) + endif() elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")