diff options
-rw-r--r-- | cmake_unofficial/CMakeLists.txt | 22 | ||||
-rw-r--r-- | examples/Makefile | 2 | ||||
-rw-r--r-- | lib/Makefile | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt index 3f113b1..af39cb0 100644 --- a/cmake_unofficial/CMakeLists.txt +++ b/cmake_unofficial/CMakeLists.txt @@ -92,21 +92,23 @@ endif() #warnings if(MSVC) -ADD_DEFINITIONS("-W4") + ADD_DEFINITIONS("-W4") endif() if(GNU_COMPATIBLE_COMPILER) -ADD_DEFINITIONS("-Wall") + ADD_DEFINITIONS("-Wall") endif() if(CMAKE_COMPILER_IS_GNUCXX) -ADD_DEFINITIONS("-Wextra") -ADD_DEFINITIONS("-Wundef") -ADD_DEFINITIONS("-Wshadow") -ADD_DEFINITIONS("-Wcast-align") -ADD_DEFINITIONS("-Wstrict-prototypes") + ADD_DEFINITIONS("-Wextra") + ADD_DEFINITIONS("-Wundef") + ADD_DEFINITIONS("-Wshadow") + ADD_DEFINITIONS("-Wcast-align") + ADD_DEFINITIONS("-Wstrict-prototypes") endif(CMAKE_COMPILER_IS_GNUCXX) -if(GNU_COMPATIBLE_COMPILER AND - (NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")) -ADD_DEFINITIONS("-std=c99") +if(GNU_COMPATIBLE_COMPILER) + # we need gnu99 instead of c99 on Linux and Solaris + # to get C99 and POSIX definitions + # an alternative with cmake >= 3.1/3.2 is the C_STANDARD property + ADD_DEFINITIONS("-std=gnu99") endif() ADD_DEFINITIONS("-DLZ4_VERSION=\"${CPACK_PACKAGE_VERSION_PATCH}\"") INCLUDE_DIRECTORIES (${LZ4_DIR}) diff --git a/examples/Makefile b/examples/Makefile index 1e4f075..c8caf24 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -28,7 +28,7 @@ # ########################################################################## CFLAGS ?= -O3 -CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes +CFLAGS += -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes FLAGS := -I../lib $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) TESTFILE= Makefile diff --git a/lib/Makefile b/lib/Makefile index 879d2b3..52e0f95 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -41,7 +41,7 @@ DESTDIR?= PREFIX ?= /usr/local CPPFLAGS= -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 -CFLAGS += -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic +CFLAGS += -std=gnu99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -pedantic FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) LIBDIR?= $(PREFIX)/lib |