Skip to content

windows-specific install options#3357

Open
gmabey wants to merge 1 commit intowarmcat:mainfrom
gmabey:debug_lib_suffix
Open

windows-specific install options#3357
gmabey wants to merge 1 commit intowarmcat:mainfrom
gmabey:debug_lib_suffix

Conversation

@gmabey
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 9 times, most recently from aca2548 to 20263de Compare July 9, 2025 18:51
@lws-team lws-team force-pushed the main branch 6 times, most recently from e028532 to 5867044 Compare August 1, 2025 12:39
@lws-team lws-team force-pushed the main branch 4 times, most recently from 36ef2d6 to c9bf70c Compare August 11, 2025 08:07
@lws-team lws-team force-pushed the main branch 9 times, most recently from e50f2bd to 10d3ba4 Compare August 23, 2025 05:45
@lws-team lws-team force-pushed the main branch 2 times, most recently from 0f65cc9 to c5ef352 Compare August 24, 2025 12:19
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