File tree 3 files changed +62
-14
lines changed
3 files changed +62
-14
lines changed Original file line number Diff line number Diff line change 40
40
cp ./LICENSE build
41
41
cp ./CHANGELOG.md build
42
42
cd build
43
+ install_name_tool -id @rpath/libplay_cpp_sdk.dylib ./lib/libplay_cpp_sdk.dylib
44
+ otool -L ./lib/libplay_cpp_sdk.dylib
43
45
tar zcvf ../play_cpp_sdk_${PLATFORM}.tar.gz *
44
46
cd ..
45
47
shasum -a 256 *.tar.gz > "checksums-$PLATFORM.txt"
Original file line number Diff line number Diff line change @@ -53,9 +53,14 @@ dynamic: easywsclient.o
53
53
$(FLAGS ) \
54
54
-L lib \
55
55
56
- x86_64_build : prepare_x86_64 easywsclient.o.x86_64
56
+ x86_64_test_dylib :
57
+ ./demo test
58
+
59
+ x86_64_build : x86_64_build_static x86_64_build_dynamic x86_64_test_dylib
60
+
61
+ x86_64_build_static : prepare_x86_64 easywsclient.o.x86_64
57
62
arch -x86_64 \
58
- g++ -o demo \
63
+ g++ -o demostatic \
59
64
easywsclient.o \
60
65
main.cc \
61
66
chainmain.cc \
@@ -65,6 +70,35 @@ x86_64_build: prepare_x86_64 easywsclient.o.x86_64
65
70
-std=c++14 \
66
71
$(FLAGS )
67
72
73
+ # use -rpath option to add the path to the dynamic library loading path
74
+ # -rpath lib in gcc or
75
+ # install_name_tool -add_rpath @executable_path/lib ./demo
76
+ # in mac, to use DYLD_LIBRARY_PATH, it is normalized to use $rpath in dylib
77
+ x86_64_build_dynamic : prepare_x86_64 easywsclient.o.x86_64
78
+ install_name_tool -id @rpath/libplay_cpp_sdk.dylib ./lib/libplay_cpp_sdk.dylib
79
+ otool -L ./lib/libplay_cpp_sdk.dylib
80
+ arch -x86_64 \
81
+ g++ -o demo \
82
+ easywsclient.o \
83
+ main.cc \
84
+ chainmain.cc \
85
+ cronos.cc \
86
+ extra.cc \
87
+ ./include/walletconnectcallback.cc \
88
+ ./include/nft.cc \
89
+ ./include/pay.cc \
90
+ ./include/defi-wallet-core-cpp/src/contract.rs.cc \
91
+ ./include/defi-wallet-core-cpp/src/core.cc \
92
+ ./include/defi-wallet-core-cpp/src/nft.rs.cc \
93
+ ./include/defi-wallet-core-cpp/src/uint.rs.cc \
94
+ ./include/extra-cpp-bindings/src/lib.rs.cc \
95
+ lib/libplay_cpp_sdk.dylib \
96
+ lib/libcxxbridge1.a \
97
+ -std=c++14 \
98
+ -rpath lib
99
+ $(FLAGS )
100
+
101
+
68
102
run_static :
69
103
. ./.env && ./demostatic
70
104
Original file line number Diff line number Diff line change 17
17
#include < thread>
18
18
19
19
int main (int argc, char *argv[]) {
20
- try {
21
- chainmain_process (); // chain-main
22
- test_chainmain_nft (); // chainmain nft tests
23
- test_login (); // decentralized login
24
- cronos_process (); // cronos
25
- test_cronos_testnet (); // cronos testnet
26
- } catch (const rust::cxxbridge1::Error &e) {
27
- // Use `Assertion failed`, the same as `assert` function
20
+ if (argc >= 2 ) {
21
+ if (" test" == std::string (argv[1 ])) {
22
+ // check wheter calling works
23
+ try {
24
+ test_wallet_connect ();
25
+ } catch (const std::exception &e) {
28
26
std::cout << " Assertion failed: " << e.what () << std::endl;
27
+ }
28
+ return 0 ;
29
29
}
30
+ }
30
31
31
- test_interval ();
32
+ try {
33
+ chainmain_process (); // chain-main
34
+ test_chainmain_nft (); // chainmain nft tests
35
+ test_login (); // decentralized login
36
+ cronos_process (); // cronos
37
+ test_cronos_testnet (); // cronos testnet
38
+ } catch (const rust::cxxbridge1::Error &e) {
39
+ // Use `Assertion failed`, the same as `assert` function
40
+ std::cout << " Assertion failed: " << e.what () << std::endl;
41
+ }
32
42
33
- test_blackscout_cronoscan ();
34
- test_wallet_connect ();
43
+ test_interval ();
35
44
36
- return 0 ;
45
+ test_blackscout_cronoscan ();
46
+ test_wallet_connect ();
47
+
48
+ return 0 ;
37
49
}
You can’t perform that action at this time.
0 commit comments