+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ 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 (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)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
add_compile_options("/EHa")
if(WIN32)
# Turn off Microsofts "security" warnings.
# also define WIN32_LEAN_AND_MEAN to fix MinGW building (and reduce size?)
add_compile_definitions(WIN32_LEAN_AND_MEAN _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)
endif()
if(MSVC)
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
endif()
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}")
# Microsoft warns against using this, especially if linking with projects that don't: https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170
# add_compile_options("/EHa")
else()
string(FIND "${CMAKE_CXX_FLAGS_DEBUG}" "-O0" nPos)
if(${nPos} EQUAL "-1")
Expand Down Expand Up @@ -58,4 +65,6 @@ if(PROJECT_IS_TOP_LEVEL)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/example.service ${NEW_FILE_CONTENTS})

install(TARGETS srvlib DESTINATION lib)
else()
target_include_directories(srvlib PUBLIC ${CMAKE_CURRENT_LIST_DIR})
endif()
1 change: 1 addition & 0 deletions ServMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#if defined(_WIN32) || defined(_WIN64)
#include <Windows.h>
#include <VersionHelpers.h>
#include <shellapi.h>
#include <conio.h>
#include "BaseSrv.h"
#include "SrvCtrl.h"
Expand Down
1 change: 1 addition & 0 deletions SrvCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#if defined(_WIN32) || defined(_WIN64)
#include "SrvCtrl.h"

#include <shellapi.h>
#include <string>
#include <VersionHelpers.h>

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载