summaryrefslogtreecommitdiff
path: root/Source/CMakeLists.txt
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-03-14 17:20:49 +0100
committerMarc Chevrier <marc.chevrier@gmail.com>2020-03-23 10:29:58 +0100
commitf034b0f66338f37d4f637916cc42b9c4a4f30a32 (patch)
tree1c4fead35ad677f82cc9fd7e837c773b00bbbf61 /Source/CMakeLists.txt
parent7099db5dd48d36e5d39ab17219278d834c8a88a7 (diff)
downloadcmake-f034b0f66338f37d4f637916cc42b9c4a4f30a32.tar.gz
CMake compilation: do not use compiler extensions
For now, compiler extensions are no longer activated on CMake sources. However these extensions are still used for various third parties. This MR is a partial answer to the issue #20454.
Diffstat (limited to 'Source/CMakeLists.txt')
-rw-r--r--Source/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 467abe9b65..564e6471a9 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -1,6 +1,11 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# 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)
+
include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")