Skip to content

windows-specific install options #3357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 2 times, most recently from 1ac7da6 to be45e59 Compare May 18, 2025 04:09
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