Skip to content

Commit

Permalink
OSX: Added separate osx-arm64 build configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Jan 1, 2021
1 parent 8fe16c6 commit 730c189
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
4 changes: 2 additions & 2 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ project "bx.test"
"pthread",
}

configuration { "osx" }
configuration { "osx*" }
links {
"Cocoa.framework",
}
Expand Down Expand Up @@ -126,7 +126,7 @@ project "bx.bench"
"pthread",
}

configuration { "osx" }
configuration { "osx*" }
links {
"Cocoa.framework",
}
Expand Down
44 changes: 20 additions & 24 deletions scripts/toolchain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function toolchain(_buildDir, _libDir)
{ "mingw-gcc", "MinGW" },
{ "mingw-clang", "MinGW (clang compiler)" },
{ "netbsd", "NetBSD" },
{ "osx", "OSX" },
{ "osx-x64", "OSX - x64" },
{ "osx-arm64", "OSX - ARM64" },
{ "orbis", "Orbis" },
{ "riscv", "RISC-V" },
{ "rpi", "RaspberryPi" },
Expand Down Expand Up @@ -361,7 +362,9 @@ function toolchain(_buildDir, _libDir)
elseif "netbsd" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-netbsd"))

elseif "osx" == _OPTIONS["gcc"] then
elseif "osx-x64" == _OPTIONS["gcc"]
or "osx-arm64" == _OPTIONS["gcc"] then


if os.is("linux") then
if not os.getenv("OSXCROSS") then
Expand All @@ -373,7 +376,8 @@ function toolchain(_buildDir, _libDir)
premake.gcc.cxx = "$(OSXCROSS)/target/bin/" .. osxToolchain .. "clang++"
premake.gcc.ar = "$(OSXCROSS)/target/bin/" .. osxToolchain .. "ar"
end
location (path.join(_buildDir, "projects", _ACTION .. "-osx"))

location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"]))

elseif "orbis" == _OPTIONS["gcc"] then

Expand Down Expand Up @@ -986,37 +990,29 @@ function toolchain(_buildDir, _libDir)
path.join(bxDir, "include/compat/freebsd"),
}

configuration { "osx", "x32" }
targetdir (path.join(_buildDir, "osx32_clang/bin"))
objdir (path.join(_buildDir, "osx32_clang/obj"))
--libdirs { path.join(_libDir, "lib/osx32_clang") }
configuration { "osx-x64" }
targetdir (path.join(_buildDir, "osx-x64/bin"))
objdir (path.join(_buildDir, "osx-x64/obj"))
buildoptions {
"-m32",
"-m64",
"-msse2",
"-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "10.11"),
}

configuration { "osx", "x64" }
targetdir (path.join(_buildDir, "osx64_clang/bin"))
objdir (path.join(_buildDir, "osx64_clang/obj"))
--libdirs { path.join(_libDir, "lib/osx64_clang") }
configuration { "osx-arm64" }
targetdir (path.join(_buildDir, "osx-arm64/bin"))
objdir (path.join(_buildDir, "osx-arm64/obj"))
buildoptions {
"-m64",
"-arch arm64",
"-Wno-error=unused-command-line-argument",
"-Wno-unused-command-line-argument",
}

configuration { "osx", "Universal" }
targetdir (path.join(_buildDir, "osx_universal/bin"))
objdir (path.join(_buildDir, "osx_universal/obj"))

configuration { "osx", "Native" }
targetdir (path.join(_buildDir, "osx/bin"))
objdir (path.join(_buildDir, "osx/obj"))

configuration { "osx" }
configuration { "osx*" }
buildoptions {
"-Wfatal-errors",
"-msse2",
"-Wunused-value",
"-Wundef",
"-target x86_64-apple-macos" .. (#macosPlatform > 0 and macosPlatform or "10.11"),
}
includedirs { path.join(bxDir, "include/compat/osx") }

Expand Down

0 comments on commit 730c189

Please sign in to comment.