Allow XPMP2 to be built as a shared library#75
Allow XPMP2 to be built as a shared library#75JeanPhilippeLebel wants to merge 10 commits intoTwinFan:masterfrom
Conversation
|
Hi @JeanPhilippeLebel , this has been sitting here for a long while. Sorry for my not replying. I'm still not convinced that building XPMP2 as a DLL is a great idea for a library that is being used by a growing number of publicly shipped plugins. Just adding one more file to take care of in the installation process is a disadvantage. And I'm fearing that once somebody starts shipping a DLL version that different versions of it could get into conflict. I'm also not quite seeing the benefit in the build process. But...you may have your reasons, so I was looking into it in recent days. DLLAs you can see I have decided against merging your Pull Request. Instead, I cherry-picked two of your initial commits and made them the basis for what ended in Pull Request #82 . Look into that if you are interested in what became of it:
Official documentation will only get updated once this versions makes it to The code is by now merged into the Other ChangesOne more commit had been added to the Pull Request, which changes other aspects of XPMP2. They look more like "private" changes for your particular use case, but as they ended up in this PR I couldn't pull the PR as I could not agree with those changes in a public library. Here is what you could do to revert back to official XPMP2 and still achieve your goals: Color of Aircraft LabelsYour change to If you don't like the standard yellow, then overwrite Hot KeyI believe a library should not define hard-coded hotkeys. It could even fail if several plugins, using XPMP2, run in parallel. And that happens to a number of users. I don't even believe a plugin should define a hard-coded hotkey. The better soluton is that the plugin offers the functionality via a "command" and that way allows the user to define a keyboard shortcut or even a joystick button to trigger it in X-Plane's configuration. Check out Additional ConfigurationThe You should have a way of configuring your plugin, either by UI or by it having a configuration file. What you tried to configure can then be set from the plugin code as follows:
|
|
Hello TwinFan, Thanks and sorry at the same time. Some of the changes (well, the last commit) were proposed by collaborator from MIT so I don't want to take for those. Good news if you found value in this. The "sorry" part is that this should have been a separate PR! One argument for supporting DLL is allow a third party integrator to update the DLL on its own. I will test the new package later this week. Good work! |
Allow XPMP2 to be built as a shared library.
The default behaviour is to build a static library. This is controlled by the XPMP2_BUILD_SHARED_LIBS cmake variable. Set it to ON to build as a static library.
This commit adds the following: