summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-11 13:10:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-11-11 13:11:15 (GMT)
commitefefd80eda94924e7723dd6928cdb48817d254a0 (patch)
tree2846a2fb51a97290f7a2886bb464e1e4b702b9f5 /Utilities
parente462807942b975912aea9752a4650c261ded6ac9 (diff)
parent019af622941ba93470c96cd148d4ca26941aafd0 (diff)
downloadCMake-efefd80eda94924e7723dd6928cdb48817d254a0.zip
CMake-efefd80eda94924e7723dd6928cdb48817d254a0.tar.gz
CMake-efefd80eda94924e7723dd6928cdb48817d254a0.tar.bz2
Merge topic 'expat-c-no-extensions'
019af62294 expat: Activate POSIX APIs even without compiler extensions Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7899
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmexpat/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utilities/cmexpat/CMakeLists.txt b/Utilities/cmexpat/CMakeLists.txt
index 9a62b79..81dfee3 100644
--- a/Utilities/cmexpat/CMakeLists.txt
+++ b/Utilities/cmexpat/CMakeLists.txt
@@ -6,6 +6,12 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
ENDIF()
+# Activate POSIX APIs.
+if(CMAKE_SYSTEM_NAME MATCHES "^(Linux)$")
+ add_definitions(-D_DEFAULT_SOURCE -D_BSD_SOURCE)
+ string(APPEND CMAKE_REQUIRED_DEFINITIONS " -D_DEFAULT_SOURCE -D_BSD_SOURCE")
+endif()
+
include(ConfigureChecks.cmake)
configure_file(expat_config.h.cmake expat_config.h @ONLY)