From e71e7104dcc012f45ac6fa4b40fcecac1d6e2361 Mon Sep 17 00:00:00 2001 From: William Edwards Date: Wed, 4 Dec 2013 22:38:06 +0100 Subject: [PATCH] Trying to build on OSX --- .gitignore | 11 +++++++++++ CMakeLists.txt | 9 +++++++-- source/glest_game/facilities/game_util.cpp | 8 ++++---- .../sources/platform/common/platform_common.cpp | 1 + 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 40024fa29..b160915d9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,17 @@ Icon .Spotlight-V100 .Trashes +# CMake when building e.g. on OSX +/CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +CMakeScripts/ +Debug/ +MegaGlest.build/ +/MegaGlest.xcodeproj/ +*.plist +*.cmake + ## Windows # Windows image file caches Thumbs.db diff --git a/CMakeLists.txt b/CMakeLists.txt index e536903ca..338dc746c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,11 @@ else() endif() ## Compiler flags + +IF(APPLE) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") +ENDIF(APPLE) + IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") MESSAGE(STATUS "Detected CLANG Compiler...") @@ -219,7 +224,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) ENDIF() ENDIF() - SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\"'") + SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\\''") IF(CMAKE_INSTALL_PREFIX STREQUAL "") @@ -242,7 +247,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) ENDIF() IF(NOT CUSTOM_DATA_INSTALL_PATH) - SET(CUSTOM_DATA_INSTALL_PATH "'\\\"${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\\\"'" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") + SET(CUSTOM_DATA_INSTALL_PATH "'\\\\'${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\\\\''" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") ENDIF() SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}") diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index 4224fb67b..4e57b57ee 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -29,12 +29,12 @@ namespace Glest { namespace Game { const char *mailString = " http://bugs.megaglest.org"; const string glestVersionString = "v3.9.0"; #if defined(GITVERSION) -const string GIT_RawRev = string(GITVERSION); -const string GIT_Rev = string("Rev: ") + string(GITVERSION); + const string GIT_RawRev = string(GITVERSION); + const string GIT_Rev = string("Rev: ") + string(GITVERSION); #elif defined(GITVERSIONHEADER) #include "gitversion.h" -const string GIT_RawRev = string(GITVERSION); -const string GIT_Rev = string("Rev: ") + string(GITVERSION); + const string GIT_RawRev = string(GITVERSION); + const string GIT_Rev = string("Rev: ") + string(GITVERSION); #else const string GIT_RawRev = "$4790$"; const string GIT_Rev = "$Rev$"; diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 2e9138283..afaae0163 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -74,6 +74,7 @@ #ifdef __APPLE__ #include +#include #endif #include "leak_dumper.h"