Browse Source

MinGW/OSX build fixes.

pull/86/head
triton 13 years ago
parent
commit
57ff6bb78c
  1. 3
      build/Helpers.lua
  2. 6
      build/premake4.lua
  3. 2
      src/AST/AST.lua
  4. 20
      src/CppParser/premake4.lua
  5. 24
      src/Parser/Parser.lua

3
build/Helpers.lua

@ -39,6 +39,9 @@ function SetupNativeProject()
buildoptions { msvc_buildflags } buildoptions { msvc_buildflags }
defines { msvc_cpp_defines } defines { msvc_cpp_defines }
configuration { "gmake" }
buildoptions { gcc_buildflags }
configuration { "macosx" } configuration { "macosx" }
buildoptions { gcc_buildflags, "-stdlib=libc++", "-fvisibility-inlines-hidden" } buildoptions { gcc_buildflags, "-stdlib=libc++", "-fvisibility-inlines-hidden" }

6
build/premake4.lua

@ -22,7 +22,7 @@ solution "CppSharp"
-- startproject "Generator" -- startproject "Generator"
configuration "Release" configuration "Release"
flags { "Optimize" } optimize()
configuration "vs2012" configuration "vs2012"
framework "4.0" framework "4.0"
@ -42,6 +42,8 @@ solution "CppSharp"
include (srcdir .. "/AST/AST.lua") include (srcdir .. "/AST/AST.lua")
include (srcdir .. "/Generator/Generator.lua") include (srcdir .. "/Generator/Generator.lua")
include (srcdir .. "/Generator.Tests/Generator.Tests.lua") include (srcdir .. "/Generator.Tests/Generator.Tests.lua")
include (srcdir .. "/Parser/Parser.lua")
include (srcdir .. "/Runtime/Runtime.lua") include (srcdir .. "/Runtime/Runtime.lua")
include (srcdir .. "/CppParser") include (srcdir .. "/CppParser")
--configuration "vs*"
--include (srcdir .. "/Parser/Parser.lua")

2
src/AST/AST.lua

@ -2,6 +2,8 @@ project "CppSharp.AST"
kind "SharedLib" kind "SharedLib"
language "C#" language "C#"
configuration "vs*"
location "." location "."
files { "*.cs" } files { "*.cs" }

20
src/CppParser/premake4.lua

@ -5,6 +5,9 @@ clang_msvc_flags =
"/wd4251" "/wd4251"
} }
LLVMRootDir = "../../deps/LLVM/"
LLVMBuildDir = "../../deps/LLVM/build_mingw/"
project "CppSharp.CppParser" project "CppSharp.CppParser"
kind "SharedLib" kind "SharedLib"
@ -28,22 +31,23 @@ project "CppSharp.CppParser"
includedirs includedirs
{ {
"../../deps/LLVM/include", path.join(LLVMRootDir, "include"),
"../../deps/LLVM/build/include", path.join(LLVMRootDir, "tools/clang/include"),
"../../deps/LLVM/tools/clang/include", path.join(LLVMRootDir, "tools/clang/lib"),
"../../deps/LLVM/tools/clang/lib", path.join(LLVMBuildDir, "include"),
"../../deps/LLVM/build/tools/clang/include" path.join(LLVMBuildDir, "tools/clang/include"),
} }
configuration { "Debug", "vs*" } configuration { "Debug", "vs*" }
libdirs { "../../deps/LLVM/build/lib/Debug" } libdirs { path.join(LLVMBuildDir, "lib/Debug") }
configuration { "Release", "vs*" } configuration { "Release", "vs*" }
libdirs { "../../deps/LLVM/build/lib/RelWithDebInfo" } libdirs { path.join(LLVMBuildDir, "lib/RelWithDebInfo") }
configuration "not vs*" configuration "not vs*"
buildoptions { "-fpermissive" }
defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" } defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" }
libdirs { "../../deps/LLVM/build/lib" } libdirs { path.join(LLVMBuildDir, "lib") }
configuration "macosx" configuration "macosx"
links { "c++", "curses", "pthread", "z" } links { "c++", "curses", "pthread", "z" }

24
src/Parser/Parser.lua

@ -13,6 +13,8 @@ project "CppSharp.Parser"
dependson { "CppSharp.AST" } dependson { "CppSharp.AST" }
flags { common_flags, "Managed" } flags { common_flags, "Managed" }
usingdirs { libdir }
-- usingdirs is only supported in per-file configs in our -- usingdirs is only supported in per-file configs in our
-- premake build. remove this once this support is added -- premake build. remove this once this support is added
-- at the project level. -- at the project level.
@ -61,17 +63,6 @@ project "CppSharp.Parser"
links links
{ {
"clangAnalysis",
"clangAST",
"clangBasic",
"clangCodeGen",
"clangDriver",
"clangEdit",
"clangFrontend",
"clangLex",
"clangParse",
"clangSema",
"clangSerialization",
"LLVMAnalysis", "LLVMAnalysis",
"LLVMAsmParser", "LLVMAsmParser",
"LLVMBitReader", "LLVMBitReader",
@ -99,4 +90,15 @@ project "CppSharp.Parser"
"LLVMX86Desc", "LLVMX86Desc",
"LLVMX86Info", "LLVMX86Info",
"LLVMX86Utils", "LLVMX86Utils",
"clangAnalysis",
"clangAST",
"clangBasic",
"clangDriver",
"clangEdit",
"clangFrontend",
"clangLex",
"clangParse",
"clangSema",
"clangSerialization",
"clangCodeGen",
} }
Loading…
Cancel
Save