]> git.lizzy.rs Git - minetest.git/blobdiff - src/CMakeLists.txt
Deduplicate code and use stdlib in string functions
[minetest.git] / src / CMakeLists.txt
index b1fd26247b844948fa53205ef5ab02a00edc499c..2fc30b842c0c62f92e048053c4836ff5a7c37673 100644 (file)
@@ -2,6 +2,7 @@ project(minetest)
 cmake_minimum_required( VERSION 2.6 )
 
 INCLUDE(CheckCSourceRuns)
+INCLUDE(CheckIncludeFiles)
 
 # Set some random things default to not being visible in the GUI
 mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
@@ -313,6 +314,11 @@ if(ENABLE_REDIS)
        endif(REDIS_LIBRARY AND REDIS_INCLUDE_DIR)
 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"
        "${PROJECT_BINARY_DIR}/cmake_config.h"
@@ -447,6 +453,7 @@ set(minetest_SRCS
        convert_json.cpp
        drawscene.cpp
        filecache.cpp
+       fontengine.cpp
        game.cpp
        guiChatConsole.cpp
        guiEngine.cpp
@@ -638,6 +645,11 @@ else()
                endif(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
        endif()
 
+       if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+               # clang does not understand __extern_always_inline but libc headers use it
+               set(OTHER_FLAGS "${OTHER_FLAGS} \"-D__extern_always_inline=extern __always_inline\"")
+       endif()
+
        if(MINGW)
                set(OTHER_FLAGS "-mthreads -fexceptions")
        endif()