Browse Source

Avoid using "action:vs* filter because there are better ones that are more specific (#1523)

pull/1524/head
josetr 5 years ago committed by GitHub
parent
commit
9e8086501a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      build/Helpers.lua
  2. 8
      build/LLVM.lua
  3. 2
      src/ASTViewer/premake5.lua
  4. 2
      src/CppParser/Bindings/CLI/premake5.lua
  5. 24
      src/CppParser/Bindings/CSharp/premake5.lua
  6. 28
      src/CppParser/premake5.lua
  7. 2
      src/Runtime/premake5.lua

26
build/Helpers.lua

@ -140,7 +140,7 @@ function SetupNativeProject() @@ -140,7 +140,7 @@ function SetupNativeProject()
-- Compiler-specific options
filter { "action:vs*" }
filter { "toolset:msc*" }
buildoptions { msvc_buildflags }
defines { msvc_cpp_defines }
@ -158,7 +158,7 @@ function SetupNativeProject() @@ -158,7 +158,7 @@ function SetupNativeProject()
buildoptions { gcc_buildflags, "-stdlib=libc++" }
links { "c++" }
filter { "system:not windows", "language:C++" }
filter { "toolset:not msc*", "language:C++" }
cppdialect "C++14"
buildoptions { "-fpermissive" }
@ -168,7 +168,7 @@ function SetupNativeProject() @@ -168,7 +168,7 @@ function SetupNativeProject()
defines { "WIN32", "_WINDOWS" }
-- For context: https://github.com/premake/premake-core/issues/935
filter {"system:windows", "action:vs*"}
filter {"system:windows", "toolset:msc*"}
systemversion("latest")
filter {}
@ -277,3 +277,23 @@ function EnableNativeProjects() @@ -277,3 +277,23 @@ function EnableNativeProjects()
return true
end
function AddPlatformSpecificFiles(folder, filename)
if os.istarget("windows") then
filter { "toolset:msc*", "architecture:x86_64" }
files { path.join(folder, "x86_64-pc-win32-msvc", filename) }
filter { "toolset:msc*", "architecture:x86" }
files { path.join(folder, "i686-pc-win32-msvc", filename) }
elseif os.istarget("macosx") then
filter { "architecture:x86_64" }
files { path.join(folder, "x86_64-apple-darwin12.4.0", filename) }
filter {"architecture:x86" }
files { path.join(folder, "i686-apple-darwin12.4.0", filename) }
elseif os.istarget("linux") then
filter { "architecture:x86_64" }
files { path.join(folder, "x86_64-linux-gnu" .. (UseCxx11ABI() and "-cxx11abi" or ""), filename) }
else
print "Unknown architecture"
end
end

8
build/LLVM.lua

@ -104,13 +104,13 @@ end @@ -104,13 +104,13 @@ end
function SetupLLVMLibs()
local c = filter()
filter { "action:not vs*" }
filter { "system:not msc*" }
defines { "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS" }
filter { "system:macosx" }
links { "c++", "curses", "pthread", "z" }
filter { "action:vs*" }
filter { "toolset:msc*" }
links { "version" }
filter {}
@ -125,10 +125,10 @@ function SetupLLVMLibs() @@ -125,10 +125,10 @@ function SetupLLVMLibs()
local LLVMBuildDir = get_llvm_build_dir()
libdirs { path.join(LLVMBuildDir, "lib") }
filter { "configurations:Debug", "action:vs*" }
filter { "configurations:Debug", "toolset:msc*" }
libdirs { path.join(LLVMBuildDir, "Debug/lib") }
filter { "configurations:Release", "action:vs*" }
filter { "configurations:Release", "toolset:msc*" }
libdirs { path.join(LLVMBuildDir, "RelWithDebInfo/lib") }
end

2
src/ASTViewer/premake5.lua

@ -28,5 +28,5 @@ project "CppSharp.ASTViewer" @@ -28,5 +28,5 @@ project "CppSharp.ASTViewer"
SetupLLVMIncludes()
SetupLLVMLibs()
filter { "action:vs*" }
filter { "toolset:msc*" }
buildoptions { "/wd4141", "/wd4146", "/wd4996" }

2
src/CppParser/Bindings/CLI/premake5.lua

@ -11,7 +11,7 @@ project "CppSharp.Parser.CLI" @@ -11,7 +11,7 @@ project "CppSharp.Parser.CLI"
flags { common_flags }
clr "On"
filter "action:vs*"
filter "toolset:msc*"
buildoptions { clang_msvc_flags }
filter {}

24
src/CppParser/Bindings/CSharp/premake5.lua

@ -13,29 +13,7 @@ project "CppSharp.Parser.CSharp" @@ -13,29 +13,7 @@ project "CppSharp.Parser.CSharp"
links { "CppSharp.Runtime" }
if os.istarget("windows") then
filter { "action:vs*", "platforms:x86" }
files { "i686-pc-win32-msvc/**.cs" }
filter { "action:vs*", "platforms:x64" }
files { "x86_64-pc-win32-msvc/**.cs" }
elseif os.istarget("macosx") then
if is_64_bits_mono_runtime() or _OPTIONS["arch"] == "x64" then
files { "x86_64-apple-darwin12.4.0/**.cs" }
else
files { "i686-apple-darwin12.4.0/**.cs" }
end
elseif os.istarget("linux") then
local abi = ""
if UseCxx11ABI() then
abi = "-cxx11abi"
end
files { "x86_64-linux-gnu"..abi.."/**.cs" }
else
print "Unknown architecture"
end
filter {}
AddPlatformSpecificFiles("", "**.cs")
function SetupParser()
links

28
src/CppParser/premake5.lua

@ -20,7 +20,7 @@ project "CppSharp.CppParser" @@ -20,7 +20,7 @@ project "CppSharp.CppParser"
linkgroups "On"
end
filter "action:vs*"
filter "toolset:msc*"
buildoptions { clang_msvc_flags }
linkoptions { "/ignore:4099" } -- LNK4099: linking object as if no debug info
@ -49,32 +49,10 @@ project "Std-symbols" @@ -49,32 +49,10 @@ project "Std-symbols"
rtti "Off"
defines { "DLL_EXPORT" }
filter { "action:vs*" }
filter { "toolset:msc*" }
buildoptions { clang_msvc_flags }
filter {}
if os.istarget("windows") then
filter { "action:vs*", "platforms:x86" }
files { "Bindings/CSharp/i686-pc-win32-msvc/Std-symbols.cpp" }
filter { "action:vs*", "platforms:x64" }
files { "Bindings/CSharp/x86_64-pc-win32-msvc/Std-symbols.cpp" }
elseif os.istarget("macosx") then
if is_64_bits_mono_runtime() or _OPTIONS["arch"] == "x64" then
files { "Bindings/CSharp/x86_64-apple-darwin12.4.0/Std-symbols.cpp" }
else
files { "Bindings/CSharp/i686-apple-darwin12.4.0/Std-symbols.cpp" }
end
elseif os.istarget("linux") then
local abi = ""
if UseCxx11ABI() then
abi = "-cxx11abi"
end
files { "Bindings/CSharp/x86_64-linux-gnu"..abi.."/Std-symbols.cpp" }
else
print "Unknown architecture"
end
filter {}
AddPlatformSpecificFiles("Bindings/CSharp", "Std-symbols.cpp")
end

2
src/Runtime/premake5.lua

@ -12,7 +12,7 @@ project "CppSharp.Runtime" @@ -12,7 +12,7 @@ project "CppSharp.Runtime"
filter { "action:not netcore"}
links { "System" }
filter { "action:vs*" }
filter { "toolset:msc*" }
defines { "MSVC" }
filter { "system:macosx" }

Loading…
Cancel
Save