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.
This commit is contained in:
Patric Stout
2019-04-07 11:57:55 +02:00
committed by glx22
parent 85315e2e31
commit 56d54cf60e
69 changed files with 3116 additions and 1144 deletions

30
src/core/CMakeLists.txt Normal file
View File

@@ -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
)

View File

@@ -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 */