Added Clang toolchain support for Linux.

This commit is contained in:
bkaradzic
2013-08-11 19:00:57 -07:00
parent 0ed41d71e7
commit 89bd13b30e
3 changed files with 42 additions and 4 deletions

View File

@@ -140,6 +140,11 @@
# pragma warning(error:4505) // ENABLE warning C4505: '' : unreferenced local function has been removed
#endif // BX_CONFIG_ENABLE_MSVC_LEVEL4_WARNINGS && BX_COMPILER_MSVC
#if BX_COMPILER_CLANG && BX_PLATFORM_LINUX
// Clang on Linux complains about missing __float128 type...
typedef struct { long double x, y; } __float128;
#endif // BX_COMPILER_CLANG && BX_PLATFORM_LINUX
#if BX_PLATFORM_WINDOWS
// http://msdn.microsoft.com/en-us/library/6sehtctf.aspx
# if !defined(WINVER) && !defined(_WIN32_WINNT)

View File

@@ -6,13 +6,13 @@
#ifndef __BX_SPSCQUEUE_H__
#define __BX_SPSCQUEUE_H__
#include <list>
#include "bx.h"
#include "cpu.h"
#include "mutex.h"
#include "uint32_t.h"
#include <list>
namespace bx
{
// http://drdobbs.com/article/print?articleId=210604448&siteSectionName=

View File

@@ -15,6 +15,7 @@ function toolchain(_buildDir, _libDir)
{ "android-arm", "Android - ARM" },
-- { "emscripten-experimental", "Emscripten" },
{ "linux", "Linux" },
{ "linux-clang", "Linux (Clang compiler)" },
{ "mingw", "MinGW" },
{ "nacl", "Native Client" },
{ "nacl-arm", "Native Client - ARM" },
@@ -74,6 +75,13 @@ function toolchain(_buildDir, _libDir)
location (_buildDir .. "projects/" .. _ACTION .. "-linux")
end
if "linux-clang" == _OPTIONS["gcc"] then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
premake.gcc.ar = "ar"
location (_buildDir .. "projects/" .. _ACTION .. "-linux-clang")
end
if "mingw" == _OPTIONS["gcc"] then
premake.gcc.cc = "$(MINGW)/bin/mingw32-gcc"
premake.gcc.cxx = "$(MINGW)/bin/mingw32-g++"
@@ -242,12 +250,21 @@ function toolchain(_buildDir, _libDir)
}
buildoptions { "-m64" }
configuration { "linux" }
configuration { "linux and not linux-clang" }
buildoptions {
"-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
}
configuration { "linux-clang" }
buildoptions {
"--analyze",
}
configuration { "linux or linux-clang" }
buildoptions {
"-std=c++0x",
"-U__STRICT_ANSI__",
"-Wunused-value",
"-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
"-msse2",
}
links {
@@ -273,6 +290,22 @@ function toolchain(_buildDir, _libDir)
"-m64",
}
configuration { "linux-clang", "x32" }
targetdir (_buildDir .. "linux32_clang" .. "/bin")
objdir (_buildDir .. "linux32_clang" .. "/obj")
libdirs { _libDir .. "lib/linux32_clang" }
buildoptions {
"-m32",
}
configuration { "linux-clang", "x64" }
targetdir (_buildDir .. "linux64_clang" .. "/bin")
objdir (_buildDir .. "linux64_clang" .. "/obj")
libdirs { _libDir .. "lib/linux64_clang" }
buildoptions {
"-m64",
}
configuration { "android-arm" }
targetdir (_buildDir .. "android-arm" .. "/bin")
objdir (_buildDir .. "android-arm" .. "/obj")