silverqx / TinyORM

Modern C++ ORM library
https://www.tinyorm.org
MIT License
242 stars 25 forks source link

Assertive TinyOrmConfig.cmake breaks static builds #21

Closed SchaichAlonso closed 1 year ago

SchaichAlonso commented 1 year ago

When searching for a TinyORM installation via find_package(TinyORM), the TinyORMConfig.cmake script generated from cmake/TinyOrmConfig.cmake.in will assert on the existance of ${TinyORM_ROOT}/bin in line 21 of it's source script and store the result into a variable that isn't referenced by the find_package logic.

If a static-only TinyORM is installed, the corresponding path will not be created during installation as the static library resides in lib rather then bin, causing find_package invokations by consuming projects to fail.

silverqx commented 1 year ago

I want to ask, are these static builds working? I don't mean installation but if you can execute it correctly and on what OS are you building?

SchaichAlonso commented 1 year ago

I'm not sure about TinyORM's primary ORM capabilities, but the querybuilder works in static linkage mode... on Debian, Manjaro, and FreeBSD.

I'll try Windows later

silverqx commented 1 year ago

Great to hear, the querybuilder is most important. The ORM is header only so that should be ok too but in C++ anything can happen.

silverqx commented 1 year ago

Also, I don't personally use static builds but always shared.

SchaichAlonso commented 1 year ago

static builds of TinyORM work on windows, too (requires #18 though, as a linker warning breaks the build due to /WX)

silverqx commented 1 year ago

I have tried CMake static build with Qt6 msvc now and I was successful, no fails.

silverqx commented 1 year ago

Tried with BUILD_SHARED_LIBS=OFF, TOM_EXAMPLE=ON, BUILD_TESTS=ON, MYSQL_PING=ON, also all tests passed so this should be ok.

SchaichAlonso commented 1 year ago

I have tried CMake static build with Qt6 msvc now and I was successful, no fails.

I'm not getting any warnings on my workstation either, however I'm seeing them occur on the github runners.

Appearently the warnings are gone on github, too, after updating TinyORM from 0.33.0 to 0.34.0 .

silverqx commented 1 year ago

Thank you, merged, also pls merge PR-s to the develop branch rather than the main branch.