feat(cqrlib): add CQRlib formula - #152
Conversation
There was a problem hiding this comment.
Review: add yayahjb/cqrlib recipe
Solid recipe that closely follows the recp/cglm pattern (shared/fPIC options, whitelist filter, onBuild/onTest, conditional -lm). The consumer sources are valid against the CQRlib-1.0.4 API, onTest correctly derives paths from the install dir so it works on a cache hit, and the fromVer comment is accurate. Two items worth addressing plus a couple of minor notes below.
Checked and fine:
filter(lines 35–47): correct whitelist — rejects only unknown option names / non-ON/OFFvalues; no prematurereturn false.-lmgating to linux/freebsd is consistent with the CMakeLists' own conditionalfind_library(M_LIB m).versions.jsonmatches the shape of the other recipes.
Minor (non-blocking):
- Relative to
recp/cglmandjson-c, this recipe is more complex (it injects its ownCMakeLists.txt, supports two options, builds C and C++ consumers) yet carries almost no explanatory comments. Consider documenting why a repo-localCMakeLists.txtreplaces the upstream build, and why the defaults (shared=OFF,fPIC=ON) were chosen — matching the comment density the sibling recipes establish. WINDOWS_EXPORT_ALL_SYMBOLS(CMakeLists:6) only affects DLL builds, so it is a no-op for the defaultshared=OFFconfig; a one-line comment noting it applies only to the shared Windows build would help.
| lastErr! | ||
|
|
||
| if slices.contains(target.options["shared"], "ON") { | ||
| os.setenv("LD_LIBRARY_PATH", filepath.join(installDir, "lib"))! |
There was a problem hiding this comment.
[P2] LD_LIBRARY_PATH/DYLD_LIBRARY_PATH overwritten instead of prepended
LD_LIBRARY_PATH and DYLD_LIBRARY_PATH are set to a single path, discarding any inherited value — unlike the Windows branch just below (line 123) which correctly reads and prepends to PATH. If the test binary depends on other shared libraries reachable only via an inherited loader path, the test could fail spuriously. Recommend reading the existing value and prepending, e.g. join installDir/lib with os.getenv("LD_LIBRARY_PATH") using :, for parity with the PATH handling. (Minor; the written value is trusted here.)
| include(GNUInstallDirs) | ||
| install(TARGETS CQRlib | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
There was a problem hiding this comment.
[P1] Hardcoded lib breaks where GNUInstallDirs uses lib64
The bundled CMakeLists.txt installs the library to ${CMAKE_INSTALL_LIBDIR} via GNUInstallDirs. On many 64-bit distros (Fedora, RHEL, openSUSE) CMAKE_INSTALL_LIBDIR resolves to lib64, but the recipe hardcodes filepath.join(installDir, "lib") for the metadata -L flag, both consumer -L flags (lines 72, 92, 108), and the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH exports (lines 119–120). On such a platform the install lands in lib64 while all flags point at lib, so the emitted metadata is wrong and the consumer link/run fails.
Recommend mirroring the json-c recipe, which pins the layout with c.define "CMAKE_INSTALL_LIBDIR", "lib" so the hardcoded lib assumption holds across platforms.
Summary
yayahjb/cqrlibFormula from the Conan Center recipeCloses #86
Validation
git diff --check