File: convert_local_source_to_external_dependencies.patch

package info (click to toggle)
xmake 3.0.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,456 kB
  • sloc: ansic: 11,336; sh: 4,376; perl: 910; cpp: 499; objc: 236; python: 113; makefile: 112; f90: 15; pascal: 13
file content (104 lines) | stat: -rw-r--r-- 2,551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Description: Convert local source to external dependencies 
Author: Lance Lin <lq27267@gmail.com>
Forwarded: not-needed
Date: 21 Aug 2023

--- a/core/src/xmake/prefix.h
+++ b/core/src/xmake/prefix.h
@@ -25,7 +25,7 @@
  * includes
  */
 #include "prefix/prefix.h"
-#include "luaconf.h"
+#include <luaconf.h>
 #if defined(TB_CONFIG_OS_WINDOWS) && defined(__cplusplus)
 #   undef LUA_API
 #   undef LUALIB_API
@@ -33,13 +33,13 @@
 #   define LUALIB_API	LUA_API
 #endif
 #ifdef USE_LUAJIT
-#   include "luajit.h"
-#   include "lualib.h"
-#   include "lauxlib.h"
+#   include <luajit.h>
+#   include <lualib.h>
+#   include <lauxlib.h>
 #else
-#   include "lua.h"
-#   include "lualib.h"
-#   include "lauxlib.h"
+#   include <lua.h>
+#   include <lualib.h>
+#   include <lauxlib.h>
 #endif
 
 /* //////////////////////////////////////////////////////////////////////////////////////
--- a/core/xmake.sh
+++ b/core/xmake.sh
@@ -215,17 +215,14 @@
     option_end
 }
 
+# Define symbol for lua-cjson if linker flag found
+lua_ldflags=`pkg-config --libs lua 2>/dev/null | tr -d " "`
+lua_cjson_ldflags="${lua_ldflags}-cjson"
+case "${LDFLAGS}" in
+    *"${lua_cjson_ldflags}"*)
+        add_defines "XM_CONFIG_API_HAVE_LUA_CJSON" "{public}"
+esac
+
 # add projects
-if ! has_config "external"; then
-    if is_config "runtime" "luajit"; then
-        includes "src/luajit"
-    else
-        includes "src/lua"
-    fi
-    includes "src/lua-cjson"
-    includes "src/lz4"
-    includes "src/sv"
-    includes "src/tbox"
-fi
 includes "src/xmake"
 includes "src/cli"
--- a/core/xmake.lua
+++ b/core/xmake.lua
@@ -130,22 +130,13 @@
 end
 
 -- add projects
-includes("src/sv", "src/lz4", "src/xmake", "src/cli")
-if namespace then
-    namespace("tbox", function ()
-        includes("src/tbox")
-    end)
-else
-    includes("src/tbox")
-end
 if has_config("lua_cjson") then
-    includes("src/lua-cjson")
-end
-if is_config("runtime", "luajit") then
-    includes("src/luajit")
-else
     includes("src/lua")
+    add_deps("lua-cjson")
+    add_defines("NDEBUG", "USE_INTERNAL_FPCONV")
+    add_defines("XM_CONFIG_API_HAVE_LUA_CJSON", {public = true})
 end
+
 if is_plat("windows") then
     includes("src/pdcurses")
 end
--- a/core/src/xmake/hash/xxhash.c
+++ b/core/src/xmake/hash/xxhash.c
@@ -32,7 +32,7 @@
 #define XXH_NAMESPACE XM_
 #define XXH_STATIC_LINKING_ONLY
 #define XXH_IMPLEMENTATION
-#include "xxhash/xxhash.h"
+#include <xxhash.h>
 
 /* //////////////////////////////////////////////////////////////////////////////////////
  * implementation