-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
executable file
·166 lines (138 loc) · 4.1 KB
/
Copy pathtest.cpp
File metadata and controls
executable file
·166 lines (138 loc) · 4.1 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//bin/true;runcpp2 "$0" "$@"; exit;
/* runcpp2
PassScriptPath: true
RequiredProfiles:
Windows: ["msvc"]
Unix: ["g++"]
OtherFilesToBeCompiled:
# Target Platform
DefaultPlatform:
# Target Profile
"g++":
- "./OtherSources/AnotherSourceFileGcc.cpp"
"msvc":
- "./OtherSources/AnotherSourceFileMSVC.cpp"
IncludePaths:
DefaultPlatform:
DefaultProfile:
- "./OtherSources"
Defines:
DefaultPlatform:
# Turns into `TEST_DEF=\"Test Define Working\"` in shell
DefaultProfile: ["TEST_DEF=\\\"Test Define Working\\\""]
Setup:
Unix:
DefaultProfile:
- "echo Setting up script... in $PWD"
Windows:
DefaultProfile:
- "echo Setting up script... in %cd%"
PreBuild:
Unix:
DefaultProfile:
- "echo Starting build... in $PWD"
Windows:
DefaultProfile:
- "echo Starting build... in %cd%"
PostBuild:
Unix:
DefaultProfile:
- "echo Build completed... in $PWD"
Windows:
DefaultProfile:
- "echo Build completed... in %cd%"
Cleanup:
Unix:
DefaultProfile:
- "echo Cleaning up script... in $PWD"
Windows:
DefaultProfile:
- "echo Cleaning up script... in %cd%"
Dependencies:
- Name: ssLogger
Platforms: [Windows, Linux, MacOS]
Source:
Git:
URL: "https://github.com/Neko-Box-Coder/ssLogger.git"
LibraryType: Shared
IncludePaths: ["Include"]
LinkProperties:
DefaultPlatform:
DefaultProfile:
SearchLibraryNames: ["ssLogger"]
ExcludeLibraryNames: ["ssLogger_SRC"]
SearchDirectories: ["./build", "./build/Debug", "./build/Release"]
Setup:
DefaultPlatform:
DefaultProfile:
- "mkdir build"
Build:
DefaultPlatform:
DefaultProfile:
- "cd build && cmake .. -DssLOG_BUILD_TYPE=SHARED"
- "cd build && cmake --build . --config Release -j 16"
FilesToCopy:
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
DefaultPlatform:
DefaultProfile:
- "./Include/ssLogger/ssLog.hpp"
- Name: System2.cpp
Source:
ImportPath: "./TestImport.yaml"
# - Name: System2.cpp
# Platforms: [DefaultPlatform]
# Source:
# Git:
# URL: "https://github.com/Neko-Box-Coder/System2.cpp.git"
# LibraryType: Header
# IncludePaths: [".", "./External/System2"]
# Setup:
# DefaultPlatform:
# DefaultProfile:
# - "git submodule update --init --recursive"
*/
//#include "ssLogger/ssLogInit.hpp"
#define ssLOG_DLL 1
#include "ssLogger/ssLog.hpp"
#include "System2.hpp"
#if defined(__GNUC__)
#include "AnotherSourceFileGcc.hpp"
#endif
#if defined(_MSC_VER)
#include "AnotherSourceFileMSVC.hpp"
#endif
#include <iostream>
#include <chrono>
int main(int argc, char* argv[])
{
std::cout << "Hello World" << std::endl;
std::cout << TEST_DEF << std::endl;
System2CommandInfo commandInfo = {};
int returnCode = 0;
#if defined(_WIN32)
System2CppRun("dir", commandInfo);
#else
auto re = System2CppRun("ls -lah", commandInfo);
#endif
System2CppGetCommandReturnValueSync(commandInfo, returnCode);
for(int i = 0; i < argc; ++i)
std::cout << "Arg" << i << ": " << argv[i] << std::endl;
#if ssLOG_USE_SOURCE
ssLOG_LINE("Source dependency is working!!!");
#else
ssLOG_LINE("Header only dependency is working!!!");
#endif
ssLOG_LINE("Multi source file is working: " << TestFunc());
int CheckCounter = 5;
ssLOG_FATAL("Test fatal: " << CheckCounter);
ssLOG_ERROR("Test error: " << CheckCounter);
ssLOG_WARNING("Test warning: " << CheckCounter);
ssLOG_INFO("Test info: " << CheckCounter);
ssLOG_DEBUG("Test debug: " << CheckCounter);
for(int i = 0; i < 100; ++i)
{
ssLOG_LINE("Logging test: " << i);
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
return 0;
}