From e8c8fbd2bf8e61e73c988e2fbd77b8602b8e62e6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Fri, 18 Jan 2019 15:54:06 +0100 Subject: [PATCH] stdutil: CMake-ify --- stdutil/CMakeLists.txt | 72 ++++++++++++++++++++++++++++++ stdutil/stdutil.cpp | 9 ++-- stdutil/{stdutil.h => stdutil.hpp} | 2 +- 3 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 stdutil/CMakeLists.txt rename stdutil/{stdutil.h => stdutil.hpp} (98%) diff --git a/stdutil/CMakeLists.txt b/stdutil/CMakeLists.txt new file mode 100644 index 0000000..35ec154 --- /dev/null +++ b/stdutil/CMakeLists.txt @@ -0,0 +1,72 @@ +project(stdutil) + +SET(PUBLIC + "stdutil.hpp" +) +SET(PRIVATE + "stdutil.cpp" +) + +add_library(${PROJECT_NAME} STATIC + ${PUBLIC} + ${PRIVATE} +) + +target_link_libraries(${PROJECT_NAME} + PUBLIC + config +) + +target_include_directories(${PROJECT_NAME} + PUBLIC ${PROJECT_SOURCE_DIR} +) + +if (WIN32) + target_compile_definitions(${PROJECT_NAME} + PRIVATE + _CRT_SECURE_NO_WARNINGS + # windows.h + WIN32_LEAN_AND_MEAN + NOGPICAPMASKS + NOVIRTUALKEYCODES + NOWINMESSAGES + NOWINSTYLES + NOSYSMETRICS + NOMENUS + NOICONS + NOKEYSTATES + NOSYSCOMMANDS + NORASTEROPS + NOSHOWWINDOW + NOATOM + NOCLIPBOARD + NOCOLOR + NOCTLMGR + NODRAWTEXT + NOGDI + NOKERNEL + NOUSER + NONLS + NOMB + NOMEMMGR + NOMETAFILE + NOMINMAX + NOMSG + NOOPENFILE + NOSCROLL + NOSERVICE + NOSOUND + NOTEXTMETRIC + NOWH + NOWINOFFSETS + NOCOMM + NOKANJI + NOHELP + NOPROFILER + NODEFERWINDOWPOS + NOMCX + NOIME + NOMDI + NOINOUT + ) +endif() diff --git a/stdutil/stdutil.cpp b/stdutil/stdutil.cpp index 45f73fb..5a9a3fb 100644 --- a/stdutil/stdutil.cpp +++ b/stdutil/stdutil.cpp @@ -1,5 +1,5 @@ -#include "stdutil.h" +#include "stdutil.hpp" #include #include @@ -127,11 +127,8 @@ void _cdecl operator delete[](void *q, const char *file, int line) { op_delete(q #else -void trackmem(bool enable) { -} - -void checkmem(ostream &out) { -} +#define trackmem +#define checkmem #endif diff --git a/stdutil/stdutil.h b/stdutil/stdutil.hpp similarity index 98% rename from stdutil/stdutil.h rename to stdutil/stdutil.hpp index 548208a..b9a4dea 100644 --- a/stdutil/stdutil.h +++ b/stdutil/stdutil.hpp @@ -4,7 +4,7 @@ #pragma warning(disable:4786) -#include "../config/config.h" +#include "config.hpp" #include #include