cstl
cstl copied to clipboard
CMake support
Hi @boazsegev ,
Build library with options to build tests and examples.
Need improvement yet to build all examples and tests.
Msys2/clang64, has patchwork block. see: https://github.com/kassane/cstl/actions/runs/6139216577/job/16656901085#step:5:75
Wow, looks amazing. Thanks!
I know CMake is extremely popular and I am thankful for this contribution.
Nice! This change allows using the dependency manager from cmake as shown in the example below.
include(FetchContent)
find_package(facil.io 0.8.0)
if (NOT facil.io_FOUND)
FetchContent_Declare(facil.io GIT_REPOSITORY https://github.com/facil-io/cstl.git
GIT_TAG master)
FetchContent_GetProperties(facil.io)
FetchContent_MakeAvailable(facil.io)
endif()
add_executable(myserver src/main.c)
target_link_libraries(myserver PRIVATE facil.io::facil.io)
I left a bunch of drive-by comments. I don't know if that's annoying, or helpful, or perhaps a bit of both. :-)
I see some other potential improvements. If the comments are more helpful than annoying, let me know and I'll take a closer look.
Btw, just to be clear: I'm knowledgeable about CMake, but I'm certainly not an expert.
I left a bunch of drive-by comments. I don't know if that's annoying, or helpful, or perhaps a bit of both. :-)
I see some other potential improvements. If the comments are more helpful than annoying, let me know and I'll take a closer look.
Btw, just to be clear: I'm knowledgeable about CMake, but I'm certainly not an expert.
No worries!
Also, I'm no expert. But thank you for your suggestions. I'll look at each one and then refactor my initial proposal.
What I'd suggest, if you're interested, is that we talk some things through first. I was leaving comments as I was reading from top to bottom; I have more, and continuing to leave them one by one might really tip the scales from "helpful" to "annoying."
If that makes sense, email might be better, to reduce noise here? But I'm OK either way.
I really am only a day into looking at this, so a question for @boazsegev: my impression, given the compile-time configurability, is that this is really meant to be a compile-time library. Am I off the mark?
Also, what's the correct name for this project — cstlor facil or facil.io? More specifically: if people are linking against something, what should that something be called? (I think facil.io is not a good choice, given the ".". But I guess facilio could be…?)
For Windows need fix
- Msys2/MinGW: https://github.com/kassane/cstl/actions/runs/6160128499/job/16716364210
- MSVC: https://github.com/kassane/cstl/actions/runs/6162172998/job/16723065934 (replace cflags, missing add
clflags)
Hi @michaellenaghan ,
Thanks for the comments and the questions.
I really am only a day into looking at this, so a question for @boazsegev: my impression, given the compile-time configurability, is that this is really meant to be a compile-time library. Am I off the mark?
In general, the CSTL is a header library that has a lot of compile time options and a nice toolset for creating commonly used types and containers...
... but there's also a bunch of sane defaults that allow the use of the compiled FIO_EVERYTHING as a good linked / static library from many use cases.
Also, what's the correct name for this project —
cstlorfacilorfacil.io?
The compiled library is the facil.io framework (I would call it facil in CMake, as the . can easily cause issues).
The facil.io is the website, that's where the v.0.8.x will go.
Hi @boazsegev , Enable build all examples and tests, gets some errors: ~~https://github.com/kassane/cstl/actions/runs/6331126625~~ - need refactoring or skip some examples and tests build?
The Windows issue will need to refactor the code before we can proceed.
@boazsegev, I have removed Windows tests on CI. I'll need some more time to fix the Windows issue. If you'd like to evaluate my latest progress, please feel free to do so.