Browse Source

Merge topic 'enable-extensions-on-qnx'

34f6d76755 QNX: Do not disable compiler extensions for CMake itself

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5537
Brad King 5 years ago
parent
commit
9fe62a34c1
1 changed files with 6 additions and 3 deletions
  1. 6 3
      Source/CMakeLists.txt

+ 6 - 3
Source/CMakeLists.txt

@@ -2,9 +2,12 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 # To ensure maximum portability across various compilers and platforms
-# deactivate any compiler extensions
-set(CMAKE_C_EXTENSIONS FALSE)
-set(CMAKE_CXX_EXTENSIONS FALSE)
+# deactivate any compiler extensions.  Skip this for QNX, where additional
+# work is needed to build without compiler extensions.
+if (NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
+  set(CMAKE_C_EXTENSIONS FALSE)
+  set(CMAKE_CXX_EXTENSIONS FALSE)
+endif()
 
 include(CheckIncludeFile)
 # Check if we can build support for ELF parsing.