summaryrefslogtreecommitdiffstats
path: root/cmake_unofficial
diff options
context:
space:
mode:
authorEric Berge <eric.berge@quantum.com>2015-04-23 20:59:09 (GMT)
committerEric Berge <eric.berge@quantum.com>2015-04-23 20:59:09 (GMT)
commita9a24e8b7f0fc17e8f667ed4e2cc8f8f9f9ee12f (patch)
treeea6e55ad206f3362718a0ae8c0007b251ba58836 /cmake_unofficial
parent9c6fb8b160e72454cb50ca78ceca428cb246fd8a (diff)
downloadlz4-a9a24e8b7f0fc17e8f667ed4e2cc8f8f9f9ee12f.zip
lz4-a9a24e8b7f0fc17e8f667ed4e2cc8f8f9f9ee12f.tar.gz
lz4-a9a24e8b7f0fc17e8f667ed4e2cc8f8f9f9ee12f.tar.bz2
cmake support for AIX, HPUX, Solaris and Windows
The following changes allow for builds on AIX and HPUX with the native (non-gcc) compilers, as well as Visual Studio 2008 and Visual Studio 2012. Also work around a build error with gcc on Solaris which fails due to the system detecting an attempt to use C99 mode with an XPG mode less than XPG6.
Diffstat (limited to 'cmake_unofficial')
-rw-r--r--cmake_unofficial/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt
index 1782ea0..77d9ca5 100644
--- a/cmake_unofficial/CMakeLists.txt
+++ b/cmake_unofficial/CMakeLists.txt
@@ -17,9 +17,11 @@ ENDIF()
option(BUILD_TOOLS "Build the command line tools" ON)
option(BUILD_LIBS "Build the libraries in addition to the tools" ON)
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
if(UNIX AND BUILD_LIBS)
add_definitions(-fPIC)
endif()
+endif()
set(LZ4_DIR ../lib/)
set(PRG_DIR ../programs/)
@@ -62,7 +64,12 @@ endif()
#warnings
+if(MSVC)
+ADD_DEFINITIONS("-W4")
+endif()
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ADD_DEFINITIONS("-Wall")
+endif()
if(CMAKE_COMPILER_IS_GNUCXX)
ADD_DEFINITIONS("-Wextra")
ADD_DEFINITIONS("-Wundef")
@@ -70,7 +77,10 @@ ADD_DEFINITIONS("-Wshadow")
ADD_DEFINITIONS("-Wcast-align")
ADD_DEFINITIONS("-Wstrict-prototypes")
endif(CMAKE_COMPILER_IS_GNUCXX)
+if((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND
+ (NOT CMAKE_SYSTEM_NAME MATCHES "SunOS"))
ADD_DEFINITIONS("-std=c99")
+endif()
ADD_DEFINITIONS("-DLZ4_VERSION=\"${CPACK_PACKAGE_VERSION_PATCH}\"")
INCLUDE_DIRECTORIES (${LZ4_DIR})