From d6a40c7523c200bce19357d80cc5ff32fb580628 Mon Sep 17 00:00:00 2001 From: o9000 Date: Sun, 19 Mar 2017 11:41:51 +0100 Subject: [PATCH] Fix compilation under Linux --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80a6c8c..232cf7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,9 +82,13 @@ if( NOT IMLIB_BUILD_WITH_X ) message( FATAL_ERROR "Imlib is not built with X support" ) endif( NOT IMLIB_BUILD_WITH_X ) -#add_definitions( -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -D_WITH_GETLINE ) -add_definitions( -D_WITH_GETLINE ) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_definitions( -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DEFAULT_SOURCE ) +else(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_definitions( -D_WITH_GETLINE ) +endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + include_directories( ${PROJECT_BINARY_DIR} src