diff options
author | Pavel Puchkin <i@neoascetic.me> | 2014-11-22 00:31:12 +0200 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2014-11-22 21:56:38 +1000 |
commit | f7f24d1470d9553fdedcc0c687f0d9bd263b4903 (patch) | |
tree | 6ef501eb0c219ccac35954bc7aa926a92f21468c | |
parent | 6c52de88fb73173d4cc039eec7e1ccf8992fd00d (diff) | |
download | minetest-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>
-rw-r--r-- | src/CMakeLists.txt | 3 |
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" |