diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f88b18 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/cmake-build-debug +/.idea diff --git a/CMakeLists.txt b/CMakeLists.txt index c88f33d..85089c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,18 +10,19 @@ endif() set(CMAKE_CXX_STANDARD 20) -if (WIN32) - set(CMAKE_CXX_FLAGS "-municode") -endif() - - file(GLOB_RECURSE SOURCES "src/*.cpp") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -include_directories(${PROJECT_SOURCE_DIR}/include) +include_directories("include") -add_library(Event SHARED ${SOURCES}) +if (UNIX) + add_library(Event SHARED ${SOURCES}) +endif() + +if (WIN32) + add_library(Event STATIC ${SOURCES}) +endif() set_target_properties(Event PROPERTIES LINKER_LANGUAGE CXX) diff --git a/include/Event.h b/include/Event.h index 01b521e..fef37d3 100644 --- a/include/Event.h +++ b/include/Event.h @@ -2,13 +2,14 @@ /// @description Templated BasicEvent Hook Class modeled after C# events /// @author Josh O'Leary - Redacted Software /// @revision 3 -/// @lastedit 2024-02-21 +/// @lastedit 2024-06-01 /// @license Unlicense - Public Domain #pragma once #include #include +#include // TODO: ThreadSafeEvent / AsyncEvent version of the class. // TODO: ConsumableEvent - a version that can be "consumed" by a callback by returning true. It will be sunk and not passed to further callbacks. diff --git a/main.cpp b/main.cpp index 7759f01..f186062 100644 --- a/main.cpp +++ b/main.cpp @@ -42,3 +42,12 @@ int main() { return 0; } + +#ifdef _WIN32 +extern "C" { + int wmain(int argc, wchar_t* argv[]) { + return main(); + } +} +#endif +