diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index d014ae2..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "version": 3, - - "configurePresets": [ - { - "name": "windows-base", - "hidden": true, - "generator": "Ninja", - "binaryDir": "${sourceDir}/out/build/${presetName}", - "installDir": "${sourceDir}/out/install/${presetName}", - "cacheVariables": { - "CMAKE_C_COMPILER": "cl.exe", - "CMAKE_CXX_COMPILER": "cl.exe" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, - - { - "name": "x64-debug", - "displayName": "x64 Debug", - "inherits": "windows-base", - "architecture": { - "value": "x64", - "strategy": "external" - }, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - - { - "name": "x64-release", - "displayName": "x64 Release", - "inherits": "x64-debug", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - } - ] -} diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..34bebaf --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,15 @@ +{ + "configurations": [ + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "" + } + ] +} \ No newline at end of file diff --git a/Common/IO.h b/Common/IO.h index d91c120..acb8bd9 100644 --- a/Common/IO.h +++ b/Common/IO.h @@ -1,13 +1,6 @@ #pragma once -// Platform specific includes // -#ifdef _WIN32 - #define NOMINMAX - #define WIN32_LEAN_AND_MEAN - #include -#else - #error "Code is currently only supported on Win32" -#endif // _WIN32 +#include #include #include diff --git a/Common/OS.h b/Common/OS.h new file mode 100644 index 0000000..95ad552 --- /dev/null +++ b/Common/OS.h @@ -0,0 +1,10 @@ +#pragma once + +// Platform specific includes // +#ifdef _WIN32 + #define NOMINMAX + #define WIN32_LEAN_AND_MEAN + #include +#else + #error "Code is currently only supported on Win32" +#endif // _WIN32 diff --git a/Common/Result.h b/Common/Result.h index f8e3076..3bd476a 100644 --- a/Common/Result.h +++ b/Common/Result.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -11,6 +13,14 @@ namespace LXC::Util explicit FunctionFail(ErrorType _err) : error(_err) { + // Only checks for a debugger when compiled in Debug mode // + #ifdef _DEBUG + + // Triggers a breakpoint when a debugger is attached as a function has failed // + if (IsDebuggerPresent()) + DebugBreak(); + + #endif } ErrorType error;