diff options
author | Patric Stout <truebrain@openttd.org> | 2019-04-07 11:57:55 +0200 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2020-06-05 19:36:05 +0200 |
commit | 56d54cf60eb5814f77dfcce91cf12879f01e1d1b (patch) | |
tree | e35fc5b7becc8f993d8c44179bc16e2586c3c64d /src/core | |
parent | 85315e2e3132dd7aff9ee96c1ba8d282350d9d5e (diff) | |
download | openttd-56d54cf60eb5814f77dfcce91cf12879f01e1d1b.tar.xz |
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.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/CMakeLists.txt | 30 | ||||
-rw-r--r-- | src/core/endian_type.hpp | 28 |
2 files changed, 33 insertions, 25 deletions
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 <sys/types.h> -# 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 <endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# define TTD_ENDIAN TTD_LITTLE_ENDIAN -# else -# define TTD_ENDIAN TTD_BIG_ENDIAN -# endif -#elif !defined(TESTING) -# include <sys/param.h> -# 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 */ |