From: vsr Date: Thu, 6 Jul 2017 15:01:19 +0000 (+0300) Subject: Disable treating of alternative C++ tokens (-fno-operator-names option for GCC) to... X-Git-Tag: V8_4_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a0ae76d11da4238beb43154d95f70165c65612dd;p=tools%2Fconfiguration.git Disable treating of alternative C++ tokens (-fno-operator-names option for GCC) to solve possible compatibility problems with MSVS --- 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)