From ec57a2af5be704bb5da32870a45ef1b22f70675e Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Thu, 7 May 2020 15:18:08 +0200 Subject: [PATCH 1/5] modified cmakelists to fix the boost mp on clang issue #3816 --- Installation/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 13ef48188f8..25a1e6b06b9 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -495,6 +495,12 @@ if( "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "ic endif() endif() +if ("${CMAKE_CXX_COMPILER}" MATCHES "xctoolchain") + message(STATUS "Clang compiler is detected.") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) + uniquely_add_flags(CMAKE_CXX_FLAGS "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() +endif() if ( CMAKE_COMPILER_IS_GNUCXX ) From fc13a42db5beaa86cc9fa66facc093b71d40f2ed Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Fri, 8 May 2020 11:41:34 +0200 Subject: [PATCH 2/5] added a comment and info message --- Installation/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 25a1e6b06b9..aaa999c0753 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -495,9 +495,11 @@ if( "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "ic endif() endif() +# This fixes the issue #3816 - https://github.com/CGAL/cgal/issues/3816. if ("${CMAKE_CXX_COMPILER}" MATCHES "xctoolchain") message(STATUS "Clang compiler is detected.") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) + message(STATUS "Boost mp is turned off for all clang versions below 11.0.3!") uniquely_add_flags(CMAKE_CXX_FLAGS "-DCGAL_DO_NOT_USE_BOOST_MP") endif() endif() From 2ef4e362c1a3cb2cc00be355fdbb5125fd46fc0b Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Mon, 11 May 2020 11:29:54 +0200 Subject: [PATCH 3/5] integrated review for the fix --- Installation/CMakeLists.txt | 8 -------- .../cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index aaa999c0753..13ef48188f8 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -495,14 +495,6 @@ if( "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "ic endif() endif() -# This fixes the issue #3816 - https://github.com/CGAL/cgal/issues/3816. -if ("${CMAKE_CXX_COMPILER}" MATCHES "xctoolchain") - message(STATUS "Clang compiler is detected.") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) - message(STATUS "Boost mp is turned off for all clang versions below 11.0.3!") - uniquely_add_flags(CMAKE_CXX_FLAGS "-DCGAL_DO_NOT_USE_BOOST_MP") - endif() -endif() if ( CMAKE_COMPILER_IS_GNUCXX ) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index 366378ea74e..6fc2e5c9edc 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -46,6 +46,15 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) message(STATUS "Mac Leopard detected") set(CGAL_APPLE_LEOPARD 1) endif() + + # This fixes the issue #3816 - https://github.com/CGAL/cgal/issues/3816. + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") + message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) + message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!") + uniquely_add_flags(CMAKE_CXX_FLAGS "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() + endif() endif() if ( NOT "${CMAKE_CFG_INTDIR}" STREQUAL "." ) From 69d174571a95d17c8e36ad5bb26bfe3f5c6d2be2 Mon Sep 17 00:00:00 2001 From: Dmitry Anisimov Date: Mon, 25 May 2020 11:25:01 +0200 Subject: [PATCH 4/5] added the missing macros include --- Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index 6fc2e5c9edc..5cf46f1adda 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -1,3 +1,5 @@ +include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) + if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) set( CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED 1 ) From dc4427c99824466fcf1da37d267be396e5a59781 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 May 2020 12:44:25 +0200 Subject: [PATCH 5/5] Move the code in CGAL_SetupCGALDependencies.cmake --- .../modules/CGAL_GeneratorSpecificSettings.cmake | 11 ----------- .../cmake/modules/CGAL_SetupCGALDependencies.cmake | 10 ++++++++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake index 5cf46f1adda..366378ea74e 100644 --- a/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake +++ b/Installation/cmake/modules/CGAL_GeneratorSpecificSettings.cmake @@ -1,5 +1,3 @@ -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) set( CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED 1 ) @@ -48,15 +46,6 @@ if ( NOT CGAL_GENERATOR_SPECIFIC_SETTINGS_FILE_INCLUDED ) message(STATUS "Mac Leopard detected") set(CGAL_APPLE_LEOPARD 1) endif() - - # This fixes the issue #3816 - https://github.com/CGAL/cgal/issues/3816. - if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") - message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3) - message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!") - uniquely_add_flags(CMAKE_CXX_FLAGS "-DCGAL_DO_NOT_USE_BOOST_MP") - endif() - endif() endif() if ( NOT "${CMAKE_CFG_INTDIR}" STREQUAL "." ) diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index ddfd3299009..16efcefef8f 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -85,7 +85,7 @@ function(CGAL_setup_CGAL_dependencies target) set(keyword PUBLIC) endif() if(CGAL_DISABLE_GMP) - target_compile_definitions(${target} ${keyword} CGAL_DISABLE_GMP=1) + target_compile_definitions(${target} ${keyword} CGAL_DISABLE_GMP=1) else() use_CGAL_GMP_support(${target} ${keyword}) set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP") @@ -95,7 +95,7 @@ function(CGAL_setup_CGAL_dependencies target) if(WITH_LEDA) use_CGAL_LEDA_support(${target} ${keyword}) endif() - + if (CGAL_HEADER_ONLY) target_compile_definitions(${target} ${keyword} CGAL_HEADER_ONLY=1) endif() @@ -121,6 +121,12 @@ function(CGAL_setup_CGAL_dependencies target) "/wd4503" # Suppress warnings C4503 about "decorated name length exceeded" "/bigobj" # Use /bigobj by default ) + 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") + message(STATUS "Boost MP is turned off for all Apple Clang versions below 11.0.3!") + target_compile_options(${target} ${keyword} "-DCGAL_DO_NOT_USE_BOOST_MP") + endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") message( STATUS "Using Intel Compiler. Adding -fp-model strict" ) if(WIN32)