diff --git a/build/Helpers.lua b/build/Helpers.lua index 0c86e0f0..3d34ac83 100644 --- a/build/Helpers.lua +++ b/build/Helpers.lua @@ -24,18 +24,6 @@ gcc_buildflags = { "-std=c++11 -fpermissive" } msvc_cpp_defines = { } -function os.is_osx() - return os.is("macosx") -end - -function os.is_windows() - return os.is("windows") -end - -function os.is_linux() - return os.is("linux") -end - function string.starts(str, start) return string.sub(str, 1, string.len(start)) == start end @@ -79,7 +67,7 @@ function SetupManagedProject() language "C#" location (path.join(builddir, "projects")) - if not os.is_osx() then + if not os.is("macosx") then local c = configuration { "vs*" } location "." configuration(c) diff --git a/build/Parser.lua b/build/Parser.lua index 6f0c138c..e8fc9a1c 100644 --- a/build/Parser.lua +++ b/build/Parser.lua @@ -11,7 +11,7 @@ function SetupCSharpParser() end function SetupParser() - if string.match(action, "vs*") and os.is_windows() then + if string.match(action, "vs*") and os.is("windows") then SetupCLIParser() else SetupCSharpParser() diff --git a/build/Tests.lua b/build/Tests.lua index a119b99e..47822968 100644 --- a/build/Tests.lua +++ b/build/Tests.lua @@ -76,7 +76,7 @@ function SetupTestGeneratorBuildEvent(name) end function SetupTestNativeProject(name, depends) - if string.starts(action, "vs") and not os.is_windows() then + if string.starts(action, "vs") and not os.is("windows") then return end @@ -141,7 +141,7 @@ function SetupTestProjectsCSharp(name, depends) end function SetupTestProjectsCLI(name, extraFiles) - if not os.is_windows() then + if not os.is("windows") then return end diff --git a/build/scripts/LLVM.lua b/build/scripts/LLVM.lua index 51c2b237..3e8c68c6 100644 --- a/build/scripts/LLVM.lua +++ b/build/scripts/LLVM.lua @@ -154,7 +154,7 @@ end function cmake(gen, conf, builddir, options) local cwd = os.getcwd() os.chdir(builddir) - local cmake = os.is_osx() and "/Applications/CMake.app/Contents/bin/cmake" + local cmake = os.is("macosx") and "/Applications/CMake.app/Contents/bin/cmake" or "cmake" local cmd = cmake .. " -G " .. '"' .. gen .. '"' .. ' -DLLVM_BUILD_TOOLS=false ' diff --git a/src/CppParser/Bindings/premake5.lua b/src/CppParser/Bindings/premake5.lua index 83e90aa1..0c3200f2 100644 --- a/src/CppParser/Bindings/premake5.lua +++ b/src/CppParser/Bindings/premake5.lua @@ -15,9 +15,9 @@ project "CppSharp.Parser.CSharp" links { "CppSharp.Runtime" } - if os.is_windows() then + if os.is("windows") then files { "CSharp/i686-pc-win32-msvc/**.cs" } - elseif os.is_osx() then + elseif os.is("macosx") then local file = io.popen("lipo -info `which mono`") local output = file:read('*all') if string.find(output, "x86_64") then @@ -26,7 +26,7 @@ project "CppSharp.Parser.CSharp" files { "CSharp/i686-apple-darwin12.4.0/**.cs" } end - elseif os.is_linux() then + elseif os.is("linux") then files { "CSharp/x86_64-linux-gnu/**.cs" } else print "Unknown architecture" @@ -34,7 +34,7 @@ project "CppSharp.Parser.CSharp" configuration "" -if string.starts(action, "vs") and os.is_windows() then +if string.starts(action, "vs") and os.is("windows") then project "CppSharp.Parser.CLI" diff --git a/src/CppParser/premake5.lua b/src/CppParser/premake5.lua index b642176f..b0b438e4 100644 --- a/src/CppParser/premake5.lua +++ b/src/CppParser/premake5.lua @@ -6,7 +6,7 @@ clang_msvc_flags = "/wd4141", -- 'inline' : used more than once } -if not (string.starts(action, "vs") and not os.is_windows()) then +if not (string.starts(action, "vs") and not os.is("windows")) then project "CppSharp.CppParser"