Files
Liu 464eed1402 build: centralize package versions and standardize on C11
versions.json is now the single source of truth; scripts/sync-versions.mjs keeps xmake descriptors, tracked version headers and package.json in sync. Sub-library versions are aligned with the published 1.0.0 packages. C11 is set at the project level, and _GNU_SOURCE is defined on POSIX so strict C11 still exposes clock_gettime, strdup and recursive pthread mutexes.
2026-11-19 22:03:59 +08:00

48 lines
1.3 KiB
Lua

if is_plat("linux") then
add_requires("libx11", {optional = true})
end
option("enable-touch")
set_showmenu(true)
set_default(true)
set_configvar("PTK_TOUCH_ENABLED", 1)
target("libptk")
set_version("1.0.0")
set_kind("$(kind)")
add_files("src/*.c")
set_configdir("include/ptk")
add_configfiles("src/config.h.in")
add_deps("yutil", "pandagl")
add_headerfiles("include/ptk.h", "include/(ptk/*.h)")
if is_kind("static") then
set_configvar("PTK_STATIC_BUILD", 1)
elseif is_plat("windows") then
add_defines("PTK_DLL_EXPORT")
end
if is_plat("windows") then
add_options("enable-touch")
add_files("src/windows/*.c")
add_links("Shell32")
else
add_files("src/linux/*.c")
add_packages("libx11")
if has_package("libx11") then
set_configvar("PTK_HAS_LIBX11", 1)
end
add_syslinks("pthread", "dl")
end
target("libptk-tests")
set_default(false)
set_kind("binary")
set_group("tests")
set_rundir("tests")
add_includedirs("src")
add_files("tests/main.c", "tests/test_steptimer.c",
"tests/test_timer_scheduler.c")
add_deps("ctest", "libptk")
add_rules("tests.runnable")
add_tests("default", {group = "tests"})