mirror of
https://github.com/ceph/ceph
synced 2024-12-16 08:26:25 +00:00
cmake: add definitions for glibc
"-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" is not for gcc, it's for glibc actually. so enable it on LINUX. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
7c06f7a461
commit
5f36c080bf
@ -18,12 +18,15 @@ set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
|
||||
add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"")
|
||||
add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS")
|
||||
if(LINUX)
|
||||
add_definitions("-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wtype-limits -Wignored-qualifiers -Winit-self")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char")
|
||||
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||
add_definitions("-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
|
Loading…
Reference in New Issue
Block a user