diff --git a/CMake/FindDeps.cmake b/CMake/FindDeps.cmake index 106526b..40cb151 100644 --- a/CMake/FindDeps.cmake +++ b/CMake/FindDeps.cmake @@ -104,7 +104,8 @@ FetchContent_Declare( FetchContent_Declare( highway GIT_REPOSITORY https://github.com/google/highway.git - GIT_TAG 1.3.0 + 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) diff --git a/Docs/BUILDING.md b/Docs/BUILDING.md index 377f720..e5aa78e 100644 --- a/Docs/BUILDING.md +++ b/Docs/BUILDING.md @@ -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 | |-------------|------------------------------|------------------------------------| diff --git a/Src/IACore/imp/cpp/Logger.cpp b/Src/IACore/imp/cpp/Logger.cpp index e166410..9fd3472 100644 --- a/Src/IACore/imp/cpp/Logger.cpp +++ b/Src/IACore/imp/cpp/Logger.cpp @@ -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() diff --git a/Src/IACore/inc/IACore/IACore.hpp b/Src/IACore/inc/IACore/IACore.hpp index c4ab1d7..ab99b9d 100644 --- a/Src/IACore/inc/IACore/IACore.hpp +++ b/Src/IACore/inc/IACore/IACore.hpp @@ -19,6 +19,33 @@ #ifdef __cplusplus +# include + +# define IACORE_MAIN() \ + Expected _app_entry(IN CONST Vector &args); \ + int main(int argc, char *argv[]) \ + { \ + int exitCode = 0; \ + IACore::Initialize(); \ + Vector 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 _app_entry(IN CONST Vector &args) + namespace IACore { // Must be called from main thread