Skip to content

Commit 8e1df6c

Browse files
committed
clean up; create release archive
1 parent 0ea6eec commit 8e1df6c

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set(SOURCES
4545

4646
add_executable(websocket_proxy ${SOURCES})
4747
target_include_directories(websocket_proxy PUBLIC include ${slick_queue_SOURCE_DIR}/include ${spdlog_SOURCE_DIR} ${RELEASE_DIR}/include)
48-
target_link_libraries(websocket_proxy PRIVATE spdlog::spdlog_header_only Boost::asio Boost::beast OpenSSL::SSL OpenSSL::Crypto)
48+
target_link_libraries(websocket_proxy PRIVATE spdlog::spdlog Boost::asio Boost::beast OpenSSL::SSL OpenSSL::Crypto)
4949
target_precompile_headers(websocket_proxy PRIVATE src/pch.hpp)
5050

5151
if (MSVC)
@@ -59,3 +59,14 @@ if (MSVC)
5959
target_compile_options(websocket_proxy PRIVATE "/bigobj")
6060
set_target_properties(websocket_proxy PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
6161
endif()
62+
63+
if (CMAKE_BUILD_TYPE MATCHES Release)
64+
add_custom_command(TARGET websocket_proxy
65+
POST_BUILD
66+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/Release ${RELEASE_DIR}/bin
67+
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "websocket_proxy_${BUILD_VERSION}.zip" --format=zip "${RELEASE_DIR}/bin" "${RELEASE_DIR}/include"
68+
WORKING_DIRECTORY "${RELEASE_DIR}"
69+
COMMENT "Creating zip archive"
70+
)
71+
endif()
72+

include/websocket_proxy/websocket_proxy_client.h

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
#pragma once
22

3-
// #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
4-
// #define WIN32_LEAN_AND_MEAN
5-
// #include <Windows.h>
6-
// #endif
7-
8-
#ifdef _WIN32
9-
# ifdef USE_ASIO
10-
// Set the proper SDK version before including boost/Asio
11-
# include <SDKDDKVer.h>
12-
// Note boost/ASIO includes Windows.h.
13-
# include <boost/asio.hpp>
14-
# else // USE_ASIO
15-
# define WIN32_LEAN_AND_MEAN
16-
# include <Windows.h>
17-
# endif // USE_ASIO
3+
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
4+
#define WIN32_LEAN_AND_MEAN
5+
#include <Windows.h>
186
#include <tlhelp32.h>
19-
#else // _WIN32
20-
# ifdef USE_ASIO
21-
# include <boost/asio.hpp>
22-
# endif // USE_ASIO
23-
#endif //_WIN32
7+
#endif
248

259
#include <cstdint>
2610
#include <thread>

0 commit comments

Comments
 (0)