From 209aec79ebb61faeff21568771524b33b26e1c2a Mon Sep 17 00:00:00 2001 From: Glen Mabey Date: Wed, 2 Apr 2025 12:33:56 -0600 Subject: [PATCH] implements LWS_APPEND_DEBUG_SUFFIX_D option now has appropriate rules for shared and static targets --- CMakeLists.txt | 3 +++ READMEs/README.coding.md | 2 +- lib/CMakeLists.txt | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9483ccb940..998674ecf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,6 +394,9 @@ endif() if (MSVC) option(LWS_MSVC_STATIC_RUNTIME "Link to static MSVC runtime" OFF) endif() +if (WIN32) + option(LWS_APPEND_DEBUG_SUFFIX_D "Append 'd' to library name when CMAKE_BUILD_TYPE=Debug" OFF) +endif() # # to use miniz, enable both LWS_WITH_ZLIB and LWS_WITH_MINIZ diff --git a/READMEs/README.coding.md b/READMEs/README.coding.md index 153f19513d..3af6e522f4 100644 --- a/READMEs/README.coding.md +++ b/READMEs/README.coding.md @@ -31,7 +31,7 @@ one after the other and gets the same benefit from the same code. Isolating and collating the protocol code in one place also makes it very easy to maintain and understand. -So it if highly recommended you put your protocol-specific code into the +So it is highly recommended you put your protocol-specific code into the form of a "plugin" at the source level, even if you have no immediate plan to use it dynamically-loaded. diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c39afc4735..6f18b0fbd7 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -190,6 +190,10 @@ if (LWS_WITH_STATIC) OUTPUT_NAME websockets_static) endif() + if (LWS_APPEND_DEBUG_SUFFIX_D) + set_target_properties(websockets PROPERTIES DEBUG_POSTFIX d) + endif() + endif() if (LWS_WITH_SHARED) @@ -240,6 +244,10 @@ if (LWS_WITH_SHARED) endif() endif() + if (LWS_APPEND_DEBUG_SUFFIX_D) + set_target_properties(websockets_shared PROPERTIES DEBUG_POSTFIX d) + endif() + endif() #