diff --git a/makefile b/makefile index ff174b0a703..58d6e1dd453 100644 --- a/makefile +++ b/makefile @@ -15,6 +15,16 @@ ################# BEGIN USER-CONFIGURABLE OPTIONS ##################### ########################################################################### +PARAMS=--distro=$(DISTRO) +ifdef TOOLS +PARAMS+= --with-tools +endif +ifdef CC +PARAMS+= --CC=$(CC) +endif +ifdef LD +PARAMS+= --LD=$(LD) +endif #------------------------------------------------- # specify core target: mame, mess, etc. @@ -232,11 +242,6 @@ GENIE=3rdparty/genie/bin/$(OS)/genie SILENT?=@ -PARAMS=--distro=$(DISTRO) -ifdef TOOLS -PARAMS+= --with-tools -endif - all: $(GENIE) $(TARGETOS)_$(ARCHITECTURE) windows_x64: generate diff --git a/scripts/genie.lua b/scripts/genie.lua index 0d0b19bb91b..1ac3dcf4a3b 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -104,6 +104,16 @@ newoption { value = "", } +newoption { + trigger = "CC", + description = "CC replacement", +} + +newoption { + trigger = "LD", + description = "LD replacement", +} + local os_version = str_to_version(_OPTIONS["os_version"]) USE_BGFX = 1 if (_OPTIONS["targetos"]=="macosx" and os_version < 100700) then diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index fe400c8325b..0c88c55fb8b 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -330,6 +330,13 @@ function toolchain(_buildDir) end end + if (_OPTIONS["CC"] ~= nil) then + premake.gcc.cc = _OPTIONS["CC"] + end + if (_OPTIONS["LD"] ~= nil) then + premake.gcc.cxx = _OPTIONS["LD"] + end + configuration {} -- reset configuration