Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
include:
- build_type: debug
lto: "n"
- build_type: release
- build_type: releasedbg
lto: "n"
- build_type: release
lto: "y"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
include:
- build_type: debug
lto: "n"
- build_type: release
- build_type: releasedbg
lto: "n"
- build_type: release
lto: "y"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
include:
- build_type: release
- build_type: releasedbg
runtimes: MD
lto: "n"
- build_type: release
Expand All @@ -33,7 +33,7 @@ jobs:

- name: Package
run: |
xmake config --yes --verbose --runtimes=${{ matrix.runtimes }} --policies=build.optimization.lto:${{ matrix.lto }}
xmake config --yes --verbose --mode=${{ matrix.build_type }} --runtimes=${{ matrix.runtimes }} --policies=build.optimization.lto:${{ matrix.lto }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
21 changes: 13 additions & 8 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set_policy("compatibility.version", "3.0")
add_requires("llvm", {
system = false,
configs = {
mode = get_config("mode"),
debug = is_mode("debug"),
shared = is_mode("debug") and not is_plat("windows"),
},
Expand All @@ -21,14 +22,12 @@ if is_mode("debug") then
end

package("llvm")
set_urls("https://github.com/llvm/llvm-project/releases/download/llvmorg-$(version)/llvm-project-$(version).src.tar.xz",
"https://github.com/llvm/llvm-project.git", {includes = sparse_checkout_list})
add_urls("https://github.com/llvm/llvm-project.git", {alias = "git", includes = sparse_checkout_list})

add_versions("20.1.5", "a069565cd1c6aee48ee0f36de300635b5781f355d7b3c96a28062d50d575fa3e")
add_versions("git:21.1.4", "llvmorg-21.1.4")
add_versions("git:20.1.5", "llvmorg-20.1.5")

if is_plat("windows") then
add_configs("debug", {description = "Enable debug symbols.", default = false, type = "boolean", readonly = true})
end
add_configs("mode", {description = "Build type", default = "releasedbg", type = "string", values = {"debug", "release", "releasedbg"}})

if is_plat("windows", "mingw") then
add_syslinks("version", "ntdll")
Expand Down Expand Up @@ -88,7 +87,13 @@ package("llvm")

-- "-DLLVM_ENABLE_PROJECTS=clang",
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))

local build_type = {
["debug"] = "Debug",
["release"] = "Release",
["releasedbg"] = "RelWithDebInfo",
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (build_type[package:config("mode")]))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DLLVM_ENABLE_LTO=" .. (package:config("lto") and "ON" or "OFF"))
if package:config("lto") then
Expand Down Expand Up @@ -176,7 +181,7 @@ package("llvm")
package:arch(),
package:plat(),
abi,
package:is_debug() and "debug" or "release",
package:config("mode"),
}, "-")

if package:config("lto") then
Expand Down
Loading