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. 4
      src/AST/AST.lua
  4. 20
      src/CppParser/premake4.lua
  5. 24
      src/Parser/Parser.lua

3
build/Helpers.lua

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

6
build/premake4.lua

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

4
src/AST/AST.lua

@ -2,7 +2,9 @@ project "CppSharp.AST" @@ -2,7 +2,9 @@ project "CppSharp.AST"
kind "SharedLib"
language "C#"
location "."
configuration "vs*"
location "."
files { "*.cs" }
links { "System", "System.Core" }

20
src/CppParser/premake4.lua

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

24
src/Parser/Parser.lua

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