From 56d54cf60eb5814f77dfcce91cf12879f01e1d1b Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 7 Apr 2019 11:57:55 +0200 Subject: Add: introduce CMake for project management CMake works on all our supported platforms, like MSVC, Mingw, GCC, Clang, and many more. It allows for a single way of doing things, so no longer we need shell scripts and vbs scripts to work on all our supported platforms. Additionally, CMake allows to generate project files for like MSVC, KDevelop, etc. This heavily reduces the lines of code we need to support multiple platforms from a project perspective. Addtiionally, this heavily improves our detection of libraries, etc. --- src/core/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ src/core/endian_type.hpp | 28 +++------------------------- 2 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 src/core/CMakeLists.txt (limited to 'src/core') diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 000000000..96da08932 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,30 @@ +add_files( + alloc_func.cpp + alloc_func.hpp + alloc_type.hpp + backup_type.hpp + bitmath_func.cpp + bitmath_func.hpp + endian_func.hpp + endian_type.hpp + enum_type.hpp + geometry_func.cpp + geometry_func.hpp + geometry_type.hpp + kdtree.hpp + math_func.cpp + math_func.hpp + mem_func.hpp + multimap.hpp + overflowsafe_type.hpp + pool_func.cpp + pool_func.hpp + pool_type.hpp + random_func.cpp + random_func.hpp + smallmap_type.hpp + smallmatrix_type.hpp + smallstack_type.hpp + smallvec_type.hpp + string_compare_type.hpp +) diff --git a/src/core/endian_type.hpp b/src/core/endian_type.hpp index 1b927ef45..e1add251e 100644 --- a/src/core/endian_type.hpp +++ b/src/core/endian_type.hpp @@ -23,30 +23,8 @@ /** Big endian builds use this for TTD_ENDIAN. */ #define TTD_BIG_ENDIAN 1 -/* Windows has always LITTLE_ENDIAN */ -#if defined(_WIN32) || defined(__OS2__) || defined(__HAIKU__) -# define TTD_ENDIAN TTD_LITTLE_ENDIAN -#elif defined(OSX) -# include -# if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN -# define TTD_ENDIAN TTD_LITTLE_ENDIAN -# else -# define TTD_ENDIAN TTD_BIG_ENDIAN -# endif -#elif defined(__OpenBSD__) -# include -# if BYTE_ORDER == LITTLE_ENDIAN -# define TTD_ENDIAN TTD_LITTLE_ENDIAN -# else -# define TTD_ENDIAN TTD_BIG_ENDIAN -# endif -#elif !defined(TESTING) -# include -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define TTD_ENDIAN TTD_LITTLE_ENDIAN -# else -# define TTD_ENDIAN TTD_BIG_ENDIAN -# endif -#endif /* _WIN32 || __OS2__ */ +#if !defined(TTD_ENDIAN) +# error "TTD_ENDIAN is not defined; please set it to either TTD_LITTLE_ENDIAN or TTD_BIG_ENDIAN" +#endif /* !TTD_ENDIAN */ #endif /* ENDIAN_TYPE_HPP */ -- cgit v1.2.3-70-g09d2