From e4d7586cddcaf988e5808a0c84ff0134b2aa068f Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Tue, 9 Sep 2014 23:56:39 +0000 Subject: [PATCH] Sets default compiler for OS X build to clang, using hack that should be replaced if we upgrade premake. Fixes linking error in ICU build from build-osx-libs.sh (it was setting the C++ compiler to clang, which is the C compiler, so it wouldn't automatically link to the c++ lib). Now build-osx-libs.sh and the game should use clang and whichever c++ lib is the default This was SVN commit r15725. --- build/premake/premake4.lua | 7 +++++++ libraries/osx/build-osx-libs.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua index 10c30ebfe1..1f5951fc5e 100644 --- a/build/premake/premake4.lua +++ b/build/premake/premake4.lua @@ -66,6 +66,13 @@ else end end +-- Hack to force clang as default compiler on OS X +-- TODO: proper clang support +if os.is("macosx") then + premake.gcc.cc = "clang" + premake.gcc.cxx = "clang++" +end + -- Set up the Solution solution "pyrogenesis" targetdir(rootdir.."/binaries/system") diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index 27698e88bf..616ffbc4a9 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -582,7 +582,7 @@ then mkdir -p source/build pushd source/build -(CXX="clang" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS -stdlib=libstdc++" LDFLAGS="$LDFLAGS -lstdc++" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-layout --enable-tools && make ${JOBS} && make install) || die "ICU build failed" +(CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-layout --enable-tools && make ${JOBS} && make install) || die "ICU build failed" popd popd touch .already-built