Use proper cmake detection of features.

This attempts to organize all needed items and places appropriate defines
in a single location. Redundant comparisons/defines were removed when noticed.

A few caveats, however:

* This may be better targeted towards the 5_1_0 branch instead of master right now.
* Cmake will run a little slower on configuration/generation now. That's due to the sanity checks it runs.
* There are some more checks to be added later, but this should be a solid start.

Thanks to the [libical](https://github.com/libical/libical) project for inspiration.
This commit is contained in:
Jason Felds
2015-09-05 10:51:17 -04:00
parent 92f449c8bf
commit e093d204c8
42 changed files with 438 additions and 159 deletions
+2
View File
@@ -4,7 +4,9 @@
#include "arch/ArchHooks/ArchHooks.h"
#include <CoreServices/CoreServices.h>
#include <sys/types.h>
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <sys/sysctl.h>
RString CrashHandler::GetLogsDirectory()
-7
View File
@@ -4,7 +4,6 @@
// Replace the main function.
extern "C" int sm_main( int argc, char *argv[] );
#define HAVE_VERSION_INFO
#define HAVE_CXA_DEMANGLE
#define HAVE_FFMPEG
#define HAVE_PTHREAD_COND_TIMEDWAIT
@@ -12,11 +11,6 @@ extern "C" int sm_main( int argc, char *argv[] );
* this in all cases. If only they could be consistent... */
#define HAVE_DECL_SIGUSR1 1
/* We have <machine/endian.h> which gets pulled in when we use gcc 4.0's <cstdlib>
* but no <endian.h>. The definitions of LITTLE_ENDIAN, BIG_ENDIAN and end up conflicting
* even though they resolve to the same thing (bug in gcc?). */
#define HAVE_MACHINE_ENDIAN_H
#define HAVE_INTTYPES_H
#define __STDC_FORMAT_MACROS
#define CRASH_HANDLER
@@ -25,7 +19,6 @@ extern "C" int sm_main( int argc, char *argv[] );
#define NO_GL_FLUSH
#define CPU_X86
#define ENDIAN_LITTLE
#define BACKTRACE_METHOD_X86_DARWIN
#define BACKTRACE_LOOKUP_METHOD_DLADDR