Skip to content

Commit

Permalink
- -k Commandline Parameter crashed the 2nd time it was called
Browse files Browse the repository at this point in the history
- Improved CMakeLists.txt
  • Loading branch information
Tomenz committed Nov 13, 2024
1 parent 059e578 commit faba636
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
23 changes: 11 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@ set(SUPPORTED_CXX_STANDARDS 14 17)
if(NOT DEFINED CMAKE_CXX_STANDARD)
message(STATUS "Setting C++ version to '14' as none was specified.")
set(CMAKE_CXX_STANDARD 14)
if (MSVC)
# Turn off Microsofts "security" warnings.
if (WIN32)
# Turn off Microsofts "security" warnings.
add_compile_definitions(_CRT_SECURE_NO_WARNINGS NDEBUG _CONSOLE _SCL_SECURE_NO_WARNINGS NOGDICAPMASKS NOVIRTUALKEYCODES NOWINMESSAGES NOWINSTYLES NOSYSMETRICS NOMENUS NOICONS NOKEYSTATES NOSYSCOMMANDS NORASTEROPS NOSHOWWINDOW OEMRESOURCE NOATOM NOCLIPBOARD NOCOLOR NOCTLMGR NODRAWTEXT NOGDI NOKERNEL NOUSER NONLS NOMB NOMEMMGR NOMETAFILE NOMINMAX NOMSG NOOPENFILE NOSCROLL NOSOUND NOTEXTMETRIC NOWH NOWINOFFSETS NOCOMM NOKANJI NOHELP NOPROFILER NODEFERWINDOWPOS NOMCX)
add_compile_options(/EHa /MT$<$<CONFIG:Debug>:d>)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
add_compile_options("/EHa")
else()
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -ggdb")
add_compile_options("-Wall" "-Wpedantic" "-Wextra" "-fexceptions")
string(FIND "${CMAKE_CXX_FLAGS_DEBUG}" "-O0" nPos)
if(${nPos} EQUAL "-1")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -ggdb -D_DEBUG -DDEBUG")
add_compile_options("-Wall" "-Wpedantic" "-Wextra" "-fexceptions")
else()
message(STATUS "${PROJECT_NAME}: CMAKE_CXX_FLAGS_DEBUG hat bereits -O0 enthalten")
endif()
endif()
else()
message(STATUS "${PROJECT_NAME}: CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} set by parent project.")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

string(FIND "${CMAKE_CXX_FLAGS_DEBUG}" "-O0" nPos)
if(${nPos} EQUAL "-1")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -ggdb -D_DEBUG -DDEBUG")
else()
message(STATUS "${PROJECT_NAME}: CMAKE_CXX_FLAGS_DEBUG hat bereits -O0 enthalten")
endif()

set(targetSrc
${CMAKE_CURRENT_LIST_DIR}/ServMain.cpp
)
Expand Down
3 changes: 3 additions & 0 deletions ServMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ class Service : public CBaseSrv
{
#if defined(_WIN32) || defined(_WIN64)
if (iSignal == SIGINT)
{
Service::GetInstance().CallSignalCallback();
signal(SIGINT, Service::SignalHandler);
}
#else
if (iSignal == SIGQUIT)
Service::GetInstance().Stop();
Expand Down

0 comments on commit faba636

Please sign in to comment.