mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 02:38:37 -06:00
Merge topic 'c-no-extensions'
c7c3e39e4fUtilities: Activate POSIX APIs even without compiler extensions3ba324b6b6libarchive: Remove a system preprocessor macro that conflicts with a local var4a283fcc31librhash: Explicitly enable large file support on 32-bit targets Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7320
This commit is contained in:
@@ -8,6 +8,14 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
|
||||
endif()
|
||||
|
||||
# Activate POSIX APIs.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(AIX|OS400)$")
|
||||
add_definitions(-D_ALL_SOURCE)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD|Darwin|Windows")
|
||||
add_definitions(-D_XOPEN_SOURCE=600)
|
||||
endif()
|
||||
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
add_library(cmbzip2
|
||||
blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)
|
||||
|
||||
@@ -119,6 +119,20 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
|
||||
endif()
|
||||
|
||||
# Activate POSIX APIs.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(AIX|OS400)$")
|
||||
add_definitions(-D_ALL_SOURCE)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux)$")
|
||||
add_definitions(-D_DEFAULT_SOURCE -D_BSD_SOURCE)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(SunOS)$")
|
||||
add_definitions(-D__EXTENSIONS__)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD|Darwin|Windows")
|
||||
add_definitions(-D_XOPEN_SOURCE=600)
|
||||
endif()
|
||||
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
|
||||
@@ -103,6 +103,16 @@ 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()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD|Darwin|Windows")
|
||||
add_definitions(-D_XOPEN_SOURCE=600)
|
||||
string(APPEND CMAKE_REQUIRED_DEFINITIONS " -D_XOPEN_SOURCE=600")
|
||||
endif()
|
||||
|
||||
IF(0) # CMake does not need flags specific to libarchive upstream development.
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
OPTION(ENABLE_WERROR "Treat warnings as errors - default is ON for Debug, OFF otherwise." ON)
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
|
||||
#define PARALLELISM_DEGREE 8
|
||||
|
||||
/* Remove system-defined preprocessor defintions that conflict with us. */
|
||||
#undef FS
|
||||
|
||||
/*
|
||||
blake2sp_init_param defaults to setting the expecting output length
|
||||
from the digest_length parameter block field.
|
||||
|
||||
@@ -166,6 +166,14 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
|
||||
ENDIF()
|
||||
|
||||
# Activate POSIX APIs.
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "^(AIX|OS400)$")
|
||||
add_definitions(-D_ALL_SOURCE)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD|Darwin|Windows")
|
||||
add_definitions(-D_XOPEN_SOURCE=600)
|
||||
endif()
|
||||
|
||||
ADD_LIBRARY(cmliblzma STATIC ${LZMA_SRCS})
|
||||
|
||||
IF(CMAKE_C_COMPILER_ID STREQUAL "XL")
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#endif
|
||||
|
||||
/* macros for large file support, must be defined before any include file */
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
|
||||
Reference in New Issue
Block a user