Allow building with sqlite3 and zlib as system libraries#15
Allow building with sqlite3 and zlib as system libraries#15teddych merged 1 commit intoteddych:masterfrom
Conversation
|
This does not build under Windows/cygwin anymore. |
I have a hard time checking this since I don't have Windows so I'm looking into setting up CI.
Odd because on my system (Fedora 43) it does work. Do you have any error that you see? |
|
It seams basically that the shortened #include does not work anymore: Original Makefile: CMake Makefile: |
|
I thought And that option is present in the right command when I look at your output: I'll do some further digging. |
|
I also have an Ubuntu Linux here. SQLite is not installed and it compiles well. It seams to be only a problem on Windows/cygwin. This was basically also the reason why I have included SQLite and zlib in the project. |
|
To compile on Windows in CI I got stuck so I opened #17 as a draft. |
These are technically standalone projects and should be treated as such. It is now possible to build and link against the system libraries. Using CMake: cmake -B build -D USE_SYSTEM_LIBRARIES=ON cmake --build build Using make: export USE_SYSTEM_LIBRARIES=1 make
86c5d55 to
e478d8b
Compare
|
I've set up a Windows VM (also to debug #17) and could reproduce the failure. The problem was a wrong include statement: #include "sqlite.h"But it needed to be: #include <sqlite.h>And CMake was missing the include directories. I haven't tried building with system libraries on Windows, but the default now works with make and CMake. |
|
Cygwin also has the libraries libsqlite3 and libz included (or can be installed). When I install them I would expect that it should be possible to compile with "export USE_SYSTEM_LIBRARIES=1" I get the linker error: g++ -g -static ArgumentHandler.o Config.o Languages.o Manager.o RailControl.o Version.o Server/Web/HtmlTag.o Server/Web/HtmlTagAccessory.o Server/Web/HtmlTagButton.o Server/Web/HtmlTagButtonCommand.o Server/Web/HtmlTagButtonCommandFullScreen.o Server/Web/HtmlTagButtonCommandPressRelease.o Server/Web/HtmlTagButtonCommandToggle.o Server/Web/HtmlTagButtonPopup.o Server/Web/HtmlTagCounter.o Server/Web/HtmlTagFeedback.o Server/Web/HtmlTagInput.o Server/Web/HtmlTagInputInteger.o Server/Web/HtmlTagInputSlider.o Server/Web/HtmlTagInputSliderLocoSpeed.o Server/Web/HtmlTagLayoutItem.o Server/Web/HtmlTagRoute.o Server/Web/HtmlTagSelect.o Server/Web/HtmlTagSelectMultiple.o Server/Web/HtmlTagSelectMultipleWithLabel.o Server/Web/HtmlTagSelectWithLabel.o Server/Web/HtmlTagSignal.o Server/Web/HtmlTagSwitch.o Server/Web/HtmlTagText.o Server/Web/HtmlTagTrack.o Server/Web/Response.o Server/Web/ResponseCsv.o Server/Web/ResponseHtml.o Server/Web/ResponseHtmlFull.o Server/Web/ResponseHtmlNotFound.o Server/Web/ResponseHtmlNotImplemented.o Server/Web/WebClient.o Server/Web/WebClientCluster.o Server/Web/WebClientCounter.o Server/Web/WebClientRoute.o Server/Web/WebClientSignal.o Server/Web/WebClientStatic.o Server/Web/WebClientText.o Server/Web/WebClientTrack.o Server/Web/WebServer.o Server/CS2/CS2Client.o Server/CS2/CS2Server.o Server/Z21/Z21Client.o Server/Z21/Z21Server.o DataModel/Accessory.o DataModel/AccessoryBase.o DataModel/Cluster.o DataModel/Counter.o DataModel/Feedback.o DataModel/HardwareHandle.o DataModel/LayoutItem.o DataModel/LockableItem.o DataModel/Loco.o DataModel/LocoBase.o DataModel/LocoFunctions.o DataModel/MultipleUnit.o DataModel/Object.o DataModel/ObjectIdentifier.o DataModel/Relation.o DataModel/Route.o DataModel/Serializable.o DataModel/Signal.o DataModel/Switch.o DataModel/Text.o DataModel/Track.o Hardware/AccessoryCache.o Hardware/CS2Tcp.o Hardware/CS2Udp.o Hardware/CcSchnitte.o Hardware/DccPpExSerial.o Hardware/DccPpExTcp.o Hardware/FeedbackCache.o Hardware/HardwareHandler.o Hardware/Hsi88.o Hardware/LocoCache.o Hardware/M6051.o Hardware/Virtual.o Hardware/ZLib.o Hardware/Protocols/DccPpEx.o Hardware/Protocols/EsuCAN.o Hardware/Protocols/LocoNet.o Hardware/Protocols/MaerklinCANCommon.o Hardware/Protocols/P50x.o Hardware/Protocols/Z21.o Logger/Logger.o Logger/LoggerServer.o Network/Serial.o Network/TcpClient.o Network/TcpConnection.o Network/TcpServer.o Network/UdpConnection.o Network/UdpServer.o Storage/Sqlite.o Storage/StorageHandler.o Storage/TransactionGuard.o Utils/Integer.o Utils/Network.o Utils/Utils.o -o railcontrol -lpthread -ldl -lsqlite3 -lz I have installed libsqlite3-devel and libsqlite3_0. Is something else needed or what do I do wrong? |
|
I haven't tested that, but I'll try to find some time to look into it. I'd also like to rebase this on #17 and add it as a separate build to verify it on all platforms. |
|
Thanks. |
|
I only tried it on Fedora, which is what I originally started sending patches: I want to build an RPM and vendored libraries is against the Fedora policy. Taking a step back, my intent for packaging is to:
Some additional steps that came up while working on the above:
Now I should admit I haven't even started evaluating the actual software to see if it fits my needs, but it's been a fun distraction. |
|
The needed packet on Ubuntu is libsqlite3-dev. Now it works for me on Ubuntu. |
|
I am very happy that you are working on this! I never found the time to do it. I knew it is everything hand made and not state of the art (on tool side at least), but I preferred to work on the software itself. |
These are technically standalone projects and should be treated as such. It is now possible to build and link against the system libraries.
Using CMake:
Using make:
export USE_SYSTEM_LIBRARIES=1 make