|
| 1 | +//bin/true;runcpp2 "$0" "$@"; exit; |
| 2 | + |
| 3 | +/* runcpp2 |
| 4 | +
|
| 5 | +PassScriptPath: true |
| 6 | +BuildType: Static |
| 7 | +RequiredProfiles: |
| 8 | + Windows: ["msvc"] |
| 9 | + Unix: ["g++"] |
| 10 | +
|
| 11 | +OtherFilesToBeCompiled: |
| 12 | + # Target Platform |
| 13 | + DefaultPlatform: |
| 14 | + # Target Profile |
| 15 | + "g++": |
| 16 | + - "./OtherSources/AnotherSourceFileGcc.cpp" |
| 17 | + "msvc": |
| 18 | + - "./OtherSources/AnotherSourceFileMSVC.cpp" |
| 19 | +
|
| 20 | +IncludePaths: |
| 21 | + DefaultPlatform: |
| 22 | + DefaultProfile: |
| 23 | + - "./OtherSources" |
| 24 | +
|
| 25 | +Defines: |
| 26 | + DefaultPlatform: |
| 27 | + # Turns into `TEST_DEF=\"Test Define Working\"` in shell |
| 28 | + DefaultProfile: ["TEST_DEF=\\\"Test Define Working\\\""] |
| 29 | +
|
| 30 | +Setup: |
| 31 | + Unix: |
| 32 | + DefaultProfile: |
| 33 | + - "echo Setting up script... in $PWD" |
| 34 | + Windows: |
| 35 | + DefaultProfile: |
| 36 | + - "echo Setting up script... in %cd%" |
| 37 | +
|
| 38 | +PreBuild: |
| 39 | + Unix: |
| 40 | + DefaultProfile: |
| 41 | + - "echo Starting build... in $PWD" |
| 42 | + Windows: |
| 43 | + DefaultProfile: |
| 44 | + - "echo Starting build... in %cd%" |
| 45 | +
|
| 46 | +PostBuild: |
| 47 | + Unix: |
| 48 | + DefaultProfile: |
| 49 | + - "echo Build completed... in $PWD" |
| 50 | + Windows: |
| 51 | + DefaultProfile: |
| 52 | + - "echo Build completed... in %cd%" |
| 53 | +
|
| 54 | +Cleanup: |
| 55 | + Unix: |
| 56 | + DefaultProfile: |
| 57 | + - "echo Cleaning up script... in $PWD" |
| 58 | + Windows: |
| 59 | + DefaultProfile: |
| 60 | + - "echo Cleaning up script... in %cd%" |
| 61 | +
|
| 62 | +Dependencies: |
| 63 | +- Name: ssLogger |
| 64 | + Platforms: [Windows, Linux, MacOS] |
| 65 | + Source: |
| 66 | + Git: |
| 67 | + URL: "https://github.com/Neko-Box-Coder/ssLogger.git" |
| 68 | + LibraryType: Shared |
| 69 | + IncludePaths: ["Include"] |
| 70 | + LinkProperties: |
| 71 | + DefaultPlatform: |
| 72 | + DefaultProfile: |
| 73 | + SearchLibraryNames: ["ssLogger"] |
| 74 | + ExcludeLibraryNames: ["ssLogger_SRC"] |
| 75 | + SearchDirectories: ["./build", "./build/Debug", "./build/Release"] |
| 76 | + Setup: |
| 77 | + DefaultPlatform: |
| 78 | + DefaultProfile: |
| 79 | + - "mkdir build" |
| 80 | + Build: |
| 81 | + DefaultPlatform: |
| 82 | + DefaultProfile: |
| 83 | + - "cd build && cmake .. -DssLOG_BUILD_TYPE=SHARED" |
| 84 | + - "cd build && cmake --build . --config Release -j 16" |
| 85 | + FilesToCopy: |
| 86 | + # Target Platform (Default, Windows, Linux, MacOS, or Unix) |
| 87 | + DefaultPlatform: |
| 88 | + DefaultProfile: |
| 89 | + - "./Include/ssLogger/ssLog.hpp" |
| 90 | +
|
| 91 | +- Name: System2.cpp |
| 92 | + Source: |
| 93 | + ImportPath: "./TestImport.yaml" |
| 94 | +
|
| 95 | +# - Name: System2.cpp |
| 96 | +# Platforms: [DefaultPlatform] |
| 97 | +# Source: |
| 98 | +# Git: |
| 99 | +# URL: "https://github.com/Neko-Box-Coder/System2.cpp.git" |
| 100 | +# LibraryType: Header |
| 101 | +# IncludePaths: [".", "./External/System2"] |
| 102 | +# Setup: |
| 103 | +# DefaultPlatform: |
| 104 | +# DefaultProfile: |
| 105 | +# - "git submodule update --init --recursive" |
| 106 | +*/ |
| 107 | + |
| 108 | + |
| 109 | +//#include "ssLogger/ssLogInit.hpp" |
| 110 | + |
| 111 | +#define ssLOG_DLL 1 |
| 112 | +#include "ssLogger/ssLog.hpp" |
| 113 | +#include "System2.hpp" |
| 114 | + |
| 115 | +#if defined(__GNUC__) |
| 116 | + #include "AnotherSourceFileGcc.hpp" |
| 117 | +#endif |
| 118 | + |
| 119 | +#if defined(_MSC_VER) |
| 120 | + #include "AnotherSourceFileMSVC.hpp" |
| 121 | +#endif |
| 122 | + |
| 123 | +#include <iostream> |
| 124 | +#include <chrono> |
| 125 | + |
| 126 | +int main(int argc, char* argv[]) |
| 127 | +{ |
| 128 | + std::cout << "Hello World" << std::endl; |
| 129 | + std::cout << TEST_DEF << std::endl; |
| 130 | + |
| 131 | + System2CommandInfo commandInfo = {}; |
| 132 | + int returnCode = 0; |
| 133 | + |
| 134 | + #if defined(_WIN32) |
| 135 | + System2CppRun("dir", commandInfo); |
| 136 | + #else |
| 137 | + auto re = System2CppRun("ls -lah", commandInfo); |
| 138 | + #endif |
| 139 | + System2CppGetCommandReturnValueSync(commandInfo, returnCode); |
| 140 | + |
| 141 | + for(int i = 0; i < argc; ++i) |
| 142 | + std::cout << "Arg" << i << ": " << argv[i] << std::endl; |
| 143 | + |
| 144 | + #if ssLOG_USE_SOURCE |
| 145 | + ssLOG_LINE("Source dependency is working!!!"); |
| 146 | + #else |
| 147 | + ssLOG_LINE("Header only dependency is working!!!"); |
| 148 | + #endif |
| 149 | + |
| 150 | + ssLOG_LINE("Multi source file is working: " << TestFunc()); |
| 151 | + |
| 152 | + int CheckCounter = 5; |
| 153 | + ssLOG_FATAL("Test fatal: " << CheckCounter); |
| 154 | + ssLOG_ERROR("Test error: " << CheckCounter); |
| 155 | + ssLOG_WARNING("Test warning: " << CheckCounter); |
| 156 | + ssLOG_INFO("Test info: " << CheckCounter); |
| 157 | + ssLOG_DEBUG("Test debug: " << CheckCounter); |
| 158 | + |
| 159 | + for(int i = 0; i < 100; ++i) |
| 160 | + { |
| 161 | + ssLOG_LINE("Logging test: " << i); |
| 162 | + std::this_thread::sleep_for(std::chrono::milliseconds(10)); |
| 163 | + } |
| 164 | + |
| 165 | + return 0; |
| 166 | +} |
0 commit comments