From 5877841729a05f778e58811c4351b9aca1e5373e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 27 Mar 2015 14:36:13 +0100 Subject: [PATCH] fixed OSX build with Clang on 10.7.x (nw) Removed internal CC and LD settings since it's not needed and can be overwritten externally now --- makefile | 19 +++++-------------- scripts/genie.lua | 6 +++++- scripts/toolchain.lua | 3 +++ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/makefile b/makefile index 2924658e9a4..e87b005b0b9 100644 --- a/makefile +++ b/makefile @@ -154,8 +154,6 @@ endif PYTHON = @python -CC = @gcc -LD = @g++ #------------------------------------------------- # distribution may change things @@ -167,25 +165,14 @@ else ifeq ($(DISTRO),debian-stable) else ifeq ($(DISTRO),ubuntu-intrepid) -# Force gcc-4.2 on ubuntu-intrepid -CC = @gcc -V 4.2 -LD = @g++-4.2 else ifeq ($(DISTRO),gcc44-generic) -CC = @gcc-4.4 -LD = @g++-4.4 else ifeq ($(DISTRO),gcc45-generic) -CC = @gcc-4.5 -LD = @g++-4.5 else ifeq ($(DISTRO),gcc46-generic) -CC = @gcc-4.6 -LD = @g++-4.6 else ifeq ($(DISTRO),gcc47-generic) -CC = @gcc-4.7 -LD = @g++-4.7 else $(error DISTRO $(DISTRO) unknown) endif @@ -313,13 +300,17 @@ CLANG_VERSION:=$(shell clang --version 2> /dev/null | grep 'LLVM [0-9]\.[0-9]' PYTHON_AVAILABLE:=$(shell python --version > /dev/null 2>&1 && echo python) CHECK_CLANG:=$(shell gcc --version 2> /dev/null | grep 'clang' | head -n 1) endif -ifneq ($(CHECK_CLANG),) + +ifeq ($(TARGETOS),macosx) +ifneq (,$(findstring 3.,$(CLANG_VERSION))) ifeq ($(ARCHITECTURE),x64) ARCHITECTURE=x64_clang else ARCHITECTURE=x86_clang endif endif +endif + ifneq ($(PYTHON_AVAILABLE),python) $(error Python is not available in path) endif diff --git a/scripts/genie.lua b/scripts/genie.lua index 02009c41cdf..d873cb5d976 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -535,7 +535,11 @@ end "-Wno-dynamic-class-memaccess", "-Wno-self-assign-field", } - + if (version >= 30200) then + buildoptions { + "-Wno-unused-value", + } + end if (version >= 30400) then buildoptions { "-Wno-inline-new-delete", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 983e739b4bb..362cfa9ebb0 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -259,6 +259,9 @@ function toolchain(_buildDir, _subDir) end if "osx-clang" == _OPTIONS["gcc"] then + premake.gcc.cc = "clang" + premake.gcc.cxx = "clang++" + premake.gcc.ar = "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end