From a0ae76d11da4238beb43154d95f70165c65612dd Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 6 Jul 2017 18:01:19 +0300 Subject: [PATCH] Disable treating of alternative C++ tokens (-fno-operator-names option for GCC) to solve possible compatibility problems with MSVS --- cmake/SalomeSetupPlatform.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/SalomeSetupPlatform.cmake b/cmake/SalomeSetupPlatform.cmake index 2948168..3d7ef60 100644 --- a/cmake/SalomeSetupPlatform.cmake +++ b/cmake/SalomeSetupPlatform.cmake @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(CheckCXXCompilerFlag) + ## Detect architecture IF(WIN32) SET(MACHINE WINDOWS) @@ -106,9 +108,14 @@ IF(NOT WIN32) ENDIF() ENDIF() +# Compiler flag to disable treating alternative C++ tokens (compatibility with MSVS) +CHECK_CXX_COMPILER_FLAG("-fno-operator-names" COMPILER_SUPPORTS_NO_OPERATOR_NAMES) +IF(COMPILER_SUPPORTS_NO_OPERATOR_NAMES) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names") +ENDIF() + IF(NOT NO_CXX11_SUPPORT) # C++11 support - INCLUDE(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) IF(COMPILER_SUPPORTS_CXX11) -- 2.39.2