aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorPavel Puchkin <i@neoascetic.me>2014-11-22 00:31:12 +0200
committerCraig Robbins <kde.psych@gmail.com>2014-11-22 21:56:38 +1000
commitf7f24d1470d9553fdedcc0c687f0d9bd263b4903 (patch)
tree6ef501eb0c219ccac35954bc7aa926a92f21468c /src/CMakeLists.txt
parent6c52de88fb73173d4cc039eec7e1ccf8992fd00d (diff)
downloadminetest-f7f24d1470d9553fdedcc0c687f0d9bd263b4903.tar.gz
minetest-f7f24d1470d9553fdedcc0c687f0d9bd263b4903.tar.bz2
minetest-f7f24d1470d9553fdedcc0c687f0d9bd263b4903.zip
Fix compiling if no endian.h found
f7d6509 introduces error when no endian.h found in the system. Since "CHECK_INCLUDE_FILE" returns empty string instead of "0", when "cmake_config.h" is generated it has "#define CMAKE_HAVE_ENDIAN_H " line. Later we have "#define HAVE_ENDIAN_H CMAKE_HAVE_ENDIAN_H" in the "config.h", an thus "HAVE_ENDIAN_H" is also empty sting. Because of this, "#if HAVE_ENDIAN_H" is incorrect preprocessor directive. Signed-off-by: Craig Robbins <kde.psych@gmail.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ec6c7fbac..1a84c3714 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -315,6 +315,9 @@ if(ENABLE_REDIS)
endif(ENABLE_REDIS)
CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
+if(NOT HAVE_ENDIAN_H)
+ set(HAVE_ENDIAN_H 0)
+endif(NOT HAVE_ENDIAN_H)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"