Skip to content

Conversation

@gmabey
Copy link
Contributor

@gmabey gmabey commented Apr 2, 2025

  • Provides new top-level option LWS_APPEND_DEBUG_SUFFIX_D to allow user to indicate that Debug compile version should have a name with a d suffix, thereby enabling the release-mode version to live alongside it.
  • Adds logic to include the .pdb file in the install for Debug and RelWithDebInfo modes -- for the shared library only (of course).

@lws-team
Copy link
Member

lws-team commented Apr 3, 2025

Sorry why is this needed? When I was using windows in the 1990s, the MSVC approach was two distinct build directories, ./Release and ./Debug which contained the corresponding outputs, without any chance of conflict.

CMake is very much on board with this, since the official way to build lws is to build to a subdir, eg, mkdir Release ; cd Release ; cmake .. -DCMAKE_BUILD_TYPE=release ; make ; cd .. ; mkdir Debug ; cd Debug ; cmake .. -DCMAKE_BUILD_TYPE=debug ; make

@gmabey
Copy link
Contributor Author

gmabey commented Apr 3, 2025

Yeah I should have clarified. This doesn't relate so much to the build process as the installed layout: so that they can live alongside each other within a common installed directory. Since on windows you can only link "debug" executables with "debug" libraries, if you are switching back and forth between building the application in Debug and Release modes, then it's extremely convenient to have both Debug and Release modes of the libraries already compiled and installed somewhere.
It's certainly possible to install the artifacts to two separate directories (each with their own bin/, lib/ directories). However, in my case, there are a number of dependent libraries that are all being installed into a common install/{bin,lib,include} tree for the application to reach into.
With the .dll's (and the .pdb's, I might add) in one directory, it makes it simpler to set the PATH to just that one directory in order to find those shared libraries.
Furthermore, one may assign the cmake variable CMAKE_DEBUG_POSTFIX in the application's CMakeLists.txt so that the proper version of the .lib, .dll, and .pdb all get used for linking/debugging.
These cmake-provided facilities have been very handy to me in managing the awkwardness of the Windows library system.

now has appropriate rules for shared and static targets
@gmabey gmabey force-pushed the debug_lib_suffix branch from 1024d43 to 209aec7 Compare May 9, 2025 20:32
@lws-team lws-team force-pushed the main branch 5 times, most recently from a0c73c1 to 7c9d4bc Compare September 9, 2025 14:28
@lws-team lws-team force-pushed the main branch 12 times, most recently from a800d4a to 7f2f518 Compare September 18, 2025 08:03
@lws-team lws-team force-pushed the main branch 3 times, most recently from baf4897 to 0c7fa23 Compare October 1, 2025 14:55
@lws-team lws-team force-pushed the main branch 3 times, most recently from 2b74af4 to 5f77374 Compare October 12, 2025 10:02
@lws-team lws-team force-pushed the main branch 5 times, most recently from a677221 to 0c67054 Compare October 24, 2025 16:36
@lws-team lws-team force-pushed the main branch 2 times, most recently from f5fa440 to 278c671 Compare November 6, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants