aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDECompilerSettings.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'kde-modules/KDECompilerSettings.cmake')
-rw-r--r--kde-modules/KDECompilerSettings.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake
index 24eea3a7..583dfb57 100644
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -211,6 +211,14 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common")
endif()
+# Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor as synonyms as keywords.
+# They're not supported under Visual Studio out of the box thus using them limits the portability of code
+if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
+ CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
+ (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32))
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
+endif()
+
# Default to hidden visibility for symbols
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)