Changeset View
Changeset View
Standalone View
Standalone View
kde-modules/KDECompilerSettings.cmake
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | |||||
206 | # See https://www.ibm.com/developerworks/community/blogs/zTPF/entry/benefits_of_the_fnocommon_compile_option_peter_lemieszewski?lang=en | 206 | # See https://www.ibm.com/developerworks/community/blogs/zTPF/entry/benefits_of_the_fnocommon_compile_option_peter_lemieszewski?lang=en | ||
207 | # Note that this only applies to C code; C++ already behaves like this. | 207 | # Note that this only applies to C code; C++ already behaves like this. | ||
208 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | 208 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | ||
209 | CMAKE_C_COMPILER_ID STREQUAL "Clang" OR | 209 | CMAKE_C_COMPILER_ID STREQUAL "Clang" OR | ||
210 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | 210 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | ||
211 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common") | 211 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common") | ||
212 | endif() | 212 | endif() | ||
213 | 213 | | |||
214 | # Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor as synonyms as keywords. | ||||
215 | # They're not supported under Visual Studio out of the box thus using them limits the portability of code | ||||
216 | if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR | ||||
217 | CMAKE_C_COMPILER_ID STREQUAL "Clang" OR | ||||
218 | (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT WIN32)) | ||||
219 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names") | ||||
220 | endif() | ||||
221 | | ||||
214 | # Default to hidden visibility for symbols | 222 | # Default to hidden visibility for symbols | ||
215 | set(CMAKE_C_VISIBILITY_PRESET hidden) | 223 | set(CMAKE_C_VISIBILITY_PRESET hidden) | ||
216 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) | 224 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) | ||
217 | set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) | 225 | set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) | ||
218 | if (POLICY CMP0063) | 226 | if (POLICY CMP0063) | ||
219 | # No sane project should be affected by CMP0063, so suppress the warnings | 227 | # No sane project should be affected by CMP0063, so suppress the warnings | ||
220 | # generated by the above visibility settings in CMake >= 3.3 | 228 | # generated by the above visibility settings in CMake >= 3.3 | ||
221 | cmake_policy(SET CMP0063 NEW) | 229 | cmake_policy(SET CMP0063 NEW) | ||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |