Skip to content

Commit

Permalink
[49_6] xmake: set_configvar for OS_XXX
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Oct 3, 2023
1 parent 40f1e5b commit 472a375
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,33 @@ set_project("Mogan Applications")

set_allowedplats("wasm", "linux", "macosx", "mingw", "windows")

if is_plat("wasm") then
set_configvar("OS_WASM", true)
else
set_configvar("OS_WASM", false)
end
if is_plat("linux") then
set_configvar("OS_GNU_LINUX", true)
else
set_configvar("OS_GNU_LINUX", false)
end
if is_plat("macosx") then
set_configvar("OS_MACOS", true)
else
set_configvar("OS_MACOS", false)
end
if is_plat("mingw") then
set_configvar("OS_MINGW", true)
else
set_configvar("OS_MINGW", false)
end
if is_plat("windows") then
set_configvar("OS_WIN", true)
else
set_configvar("OS_WIN", false)
end


if is_plat("mingw") and is_host("windows") then
add_requires("mingw-w64 8.1.0")
set_toolchains("mingw@mingw-w64")
Expand Down Expand Up @@ -204,10 +231,6 @@ target("libkernel_l3") do
add_configfiles("src/System/config_l3.h.xmake", {
filename = "L3/config.h",
variables = {
OS_MINGW = is_plat("mingw"),
OS_MACOS = is_plat("macosx"),
OS_WIN = is_plat("windows"),
OS_WASM = is_plat("wasm"),
QTTEXMACS = false,
}
})
Expand Down Expand Up @@ -289,11 +312,6 @@ add_configfiles("src/System/config.h.xmake", {
GS_FONTS = "../share/ghostscript/fonts:/usr/share/fonts:",
GS_LIB = "../share/ghostscript/9.06/lib:",
NOMINMAX = is_plat("windows"),
OS_GNU_LINUX = is_plat("linux"),
OS_MACOS = is_plat("macosx"),
OS_MINGW = is_plat("mingw"),
OS_WIN = is_plat("windows"),
OS_WASM = is_plat("wasm"),
MACOSX_EXTENSIONS = is_plat("macosx"),
SIZEOF_VOID_P = 8,
USE_FONTCONFIG = is_plat("linux"),
Expand Down Expand Up @@ -520,11 +538,6 @@ function add_target_draw()
add_configfiles("src/System/config.h.xmake", {
filename = "draw/config.h",
variables = {
OS_GNU_LINUX = is_plat("linux"),
OS_MACOS = is_plat("macosx"),
OS_MINGW = is_plat("mingw"),
OS_WIN = is_plat("windows"),
OS_WASM = is_plat("wasm"),
MACOSX_EXTENSIONS = is_plat("macosx"),
USE_PLUGIN_PDF = false,
USE_PLUGIN_BIBTEX = false,
Expand Down Expand Up @@ -619,11 +632,6 @@ function add_target_code()
add_configfiles("src/System/config.h.xmake", {
filename = "code/config.h",
variables = {
OS_GNU_LINUX = is_plat("linux"),
OS_MACOS = is_plat("macosx"),
OS_MINGW = is_plat("mingw"),
OS_WIN = is_plat("windows"),
OS_WASM = is_plat("wasm"),
MACOSX_EXTENSIONS = is_plat("macosx"),
USE_PLUGIN_PDF = false,
USE_PLUGIN_BIBTEX = false,
Expand Down Expand Up @@ -718,11 +726,6 @@ function add_target_research_on_wasm()
add_configfiles("src/System/config.h.xmake", {
filename = "research/config.h",
variables = {
OS_GNU_LINUX = is_plat("linux"),
OS_MACOS = is_plat("macosx"),
OS_MINGW = is_plat("mingw"),
OS_WIN = is_plat("windows"),
OS_WASM = is_plat("wasm"),
MACOSX_EXTENSIONS = is_plat("macosx"),
USE_PLUGIN_PDF = false,
USE_PLUGIN_BIBTEX = true,
Expand Down

0 comments on commit 472a375

Please sign in to comment.