From 6ae1d179bbbe41ed85b6d41d283f76be875eef18 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Wed, 4 Dec 2013 14:54:02 -0800 Subject: [PATCH] - updated for proper build on Mac --- CMakeLists.txt | 17 ++++++++++++++--- .../sources/platform/common/platform_common.cpp | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e536903c..ad8ec053 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,10 @@ 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,8 +223,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) ENDIF() ENDIF() - SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\"'") - +IF(APPLE) + SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\\''") +ELSE() + SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\"'") +ENDIF() IF(CMAKE_INSTALL_PREFIX STREQUAL "") MESSAGE(STATUS "*NOTE: NOT USING a Custom Data Install Path...") @@ -242,7 +249,11 @@ 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)") + IF(APPLE) + 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)") + ELSE() + 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() ENDIF() SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}") diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 2e913828..afaae016 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"