Refactor CMakeLists.txt files - #361
Conversation
|
I built this pair locally on Linux, Qt5 and Qt6, after applying three fixes. Commenting here for both PRs, with the two root-repo blockers noted in RetroShare/RetroShare#3288. Worth saying up front: no CI run on either PR has reached the compile step. All of them fail at submodule initialisation, so none of those logs contains compiler output. Blockers1. 2. This duplicate listing predates your PR — it's on master too, harmless there because 3. Windows and Android can't configure at all. Same code path: Other findings
Testing caveatLinux desktop only so far, Qt5 and Qt6, which is a static build. The current build also works on Windows, macOS and Android, so that's the bar this pair needs to clear. Blocker 3 is Windows and Android only and I haven't triggered it — Android has no CI at all, so it would surface only when someone runs I have fixes for blockers 1 and 2 on a branch and can open a PR against |
|
That all looks simple enough to fix. Regarding Oops. I didn't realize It seems that a lot of these issues are triggered by Windows/Android/shared compilation. I don't have an Android toolchain, so I can't really test that, but I can try testing with mingw in the future. Also I should probably test a shared build on Linux. |
|
Agreed on One correction to my earlier comment: I said the two That Linux shared build won't reach blocker 3 though — both offending blocks are inside |
- improve version detection with GetGitRevisionDecription module - move dependency management implementation details to the superproject - divorces creating the library target and adding sources - use source/header file sets - move all json api generator stuff to the src/jsonapi subdirectory - use configure_file to configure the jsonapi doxygen file - use install components intead of the RS_LIBRETROSHARE_STANDALONE_INSTALL cache variable - fixes the install destination paths (they should be relative to the install prefix--not absolute)
- Fix quoting for LIBRS_*_VERSION definitions. - Fix RS_DATA_DIR compile definition to use absoute path. - Fix rnp and openpgpsdk library visibility. - Remove duplicated target_link_options for Windows and Android. - Explicitly set CMAKE_CXX_STANDARD to avoid depending on the definition from the superproject. - Move set(CMAKE_POSITION_INDEPENDENT_CODE ON) to superproject because it is for dependencies. - Move find_package(Xapian) close to use. - Remove duplicated `#include "retroshare/rsversion.h"` in rsinit.cc
c78f461 to
7b97501
Compare
|
I addressed all your points except for the CI stuff. I pushed what I have, but I have done only basic testing so far. This PR never added .cc files to RS_IMPLEMENTATION_HEADERS -- those .cc files were there on master until a recent patch, which came after this PR was created. I rebased onto the latest master to adopt the fix. |
|
You're right about the Confirmed the rest of The standalone question is now answered by your own CI
Those jobs build libretroshare on its own, outside the super-project, with only system packages. On So it's a real decision, not just red CI: either Three things that survive a green build1. The JSON API generates nothing. 2. Public headers are no longer installed. master set 3. Minor, same area: |
It is the intent of this PR to separate libretroshare from depending on and making assumptions about the superproject. libretroshare master assumes that it will be inside the superproject by referencing Therefore, I propose changing the CI jobs to provide all necessary dependencies in typical system install locations. For dependencies that are not CMake-aware, libretroshare can include Find Modules to find those dependencies in their typical locations. An alternative is to move all the libretroshare dependencies from the superproject and make them submodules inside libretroshare. |
|
Could you describe what you mean here? The |
|
You're right, and my remark doesn't stand — I mistook the removal of the Also confirmed Two things left from that list. On the standalone question: your framing makes sense to me — the |
|
I'm aware there is some work to be done on build scripts and CI that I haven't gotten to yet, and that includes prepare-toolchain-clang.sh. I removed the loop that explicitly installs each element of |
|
Confirmed, and my point was wrong. I mirrored the layout in a minimal project to check: installing the One thing that makes it even safer than you assumed: that loop wasn't installing anything at all. The Good to know the build scripts and CI are on your list; that covers my |
d590270 to
7b8962f
Compare
|
Nice to see
The workflow hard-codes Also, only |
|
I'm not really sure how the mingw workflow is supposed to work because it references submodules that never were a part of this git repo. |
|
I tried transferring my changes to the Ubuntu CI to the Windows and Mac CI jobs. For the Ubuntu workflow, I was able to use act to test it locally, but I don't have a good way to test the other workflows and iteratively debug. |
As it stands, this requires a pretty recent version of CMake because I use the SOURCES file set type. I can work on supporting older versions of CMake, but for now I'd like some feedback on what I have.
This PR should be paired with RetroShare/RetroShare#3288 .