From b236063dffe0eaf5c0ed651bc1f5515408031dac Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Sat, 31 Dec 2016 15:44:12 +0100 Subject: [PATCH] cmake: hopefully fix clang compilation errors --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62a0a02..1e60de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,9 @@ test_big_endian(GMIO_HOST_IS_BIG_ENDIAN) if(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE) # Enable strict ISO C99 conformance set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic-errors") - add_definitions(-D_POSIX_SOURCE) + if(CMAKE_COMPILER_IS_GNUCC) + add_definitions(-D_POSIX_SOURCE) + endif() message(STATUS "CMAKE_SHARED_LIBRARY_C_FLAGS = ${CMAKE_SHARED_LIBRARY_C_FLAGS}") message(STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")