Files
LCUI/lib/ptk/xmake.lua
T
Liu 3801fdc10f refactor(yutil): rename public APIs and migrate timer to ptk
- charset module renamed to encoding (decode/encode kept)
- time: get_time_ms → y_gettime, sleep_ms → y_sleep
- time: delete get_time_us, get_time_delta, sleep_s
- string: strdup2 → y_strdup, wcsdup2 → y_wcsdup
- string: strtolower → y_strlower, strtrim → y_strtrim
- string: wcstrim → y_wcstrim, strhash → y_strhash
- string: strreplace → y_strreplace, strsplit → y_strsplit
- string: delete wcsreplace, cmdsplit
- math: delete y_iround, y_pow2
- timer module migrated from yutil to ptk as internal timer_scheduler
- WinMain simplified to use __argc/__argv instead of cmdsplit

BREAKING CHANGE: all renamed yutil public APIs require downstream
  to update function names. Deleted APIs require code changes:
  - get_time_us: use y_gettime() for ms timestamps
  - get_time_delta: use y_gettime() - start instead
  - sleep_s: use y_sleep(ms) with millisecond argument
  - wcsreplace: no replacement, had zero callers
  - cmdsplit: WinMain now uses __argc/__argv from CRT
  - timer_list_*: migrated to ptk timer_scheduler_*;
    ptk_reset_timer still available for external use
2026-08-05 22:42:26 +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("0.1.0-a")
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"})