This commit is contained in:
2025-12-27 18:24:46 +05:30
parent 4167e5d55f
commit 1e6351a12f
4 changed files with 40 additions and 16 deletions

View File

@ -105,6 +105,7 @@ FetchContent_Declare(
highway
GIT_REPOSITORY https://github.com/google/highway.git
GIT_TAG 1.3.0
SYSTEM
)
set(MI_OVERRIDE ON CACHE BOOL "" FORCE)
@ -121,15 +122,17 @@ set(HTTPLIB_COMPILE OFF CACHE BOOL "" FORCE)
set(HTTPLIB_TEST OFF CACHE BOOL "" FORCE)
set(HTTPLIB_EXAMPLE OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(zlib zstd httplib pugixml nlohmann_json glaze simdjson tl-expected unordered_dense mimalloc highway)
if(NOT TARGET simdjson::simdjson)
add_library(simdjson::simdjson ALIAS simdjson)
endif()
FetchContent_MakeAvailable(zlib zstd)
if(NOT TARGET zstd::libzstd)
add_library(zstd::libzstd ALIAS libzstd_static)
endif()
get_target_property(HWY_INCLUDE_DIRS hwy INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(hwy SYSTEM INTERFACE ${HWY_INCLUDE_DIRS})
FetchContent_MakeAvailable(httplib pugixml nlohmann_json glaze simdjson tl-expected unordered_dense mimalloc highway)
if(NOT TARGET simdjson::simdjson)
add_library(simdjson::simdjson ALIAS simdjson)
endif()
target_compile_options(hwy PRIVATE -w)
target_compile_options(libzstd_static PRIVATE -w)

View File

@ -26,13 +26,7 @@ cmake --preset windows-x64
cmake --build --preset windows-x64
```
**3. Test (Optional)**
```bash
ctest --preset windows-x64
```
### Presets
### Available Presets
|Preset |Description |Toolchain |
|-------------|------------------------------|------------------------------------|

View File

@ -19,7 +19,7 @@
namespace IACore
{
Logger::ELogLevel Logger::s_logLevel{Logger::ELogLevel::WARN};
Logger::ELogLevel Logger::s_logLevel{Logger::ELogLevel::INFO};
std::ofstream Logger::s_logFile{};
VOID Logger::Initialize()

View File

@ -19,6 +19,33 @@
#ifdef __cplusplus
# include <IACore/Logger.hpp>
# define IACORE_MAIN() \
Expected<INT32, String> _app_entry(IN CONST Vector<String> &args); \
int main(int argc, char *argv[]) \
{ \
int exitCode = 0; \
IACore::Initialize(); \
Vector<String> args; \
for (int i = 0; i < argc; i++) \
args.push_back(argv[i]); \
const auto result = _app_entry(args); \
if (!result) \
{ \
IACore::Logger::Error("Application exited with an error: '{}'.", result.error()); \
exitCode = -20; \
} \
exitCode = *result; \
if (!exitCode) \
IACore::Logger::Info("Application exited successfully."); \
else \
IACore::Logger::Error("Application exited with error code: {}.", exitCode); \
IACore::Terminate(); \
return exitCode; \
} \
Expected<INT32, String> _app_entry(IN CONST Vector<String> &args)
namespace IACore
{
// Must be called from main thread