cstl icon indicating copy to clipboard operation
cstl copied to clipboard

CMake support

Open kassane opened this issue 2 years ago • 9 comments

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

kassane avatar Sep 10 '23 20:09 kassane

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)

kassane avatar Sep 12 '23 13:09 kassane

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.

michaellenaghan avatar Sep 19 '23 15:09 michaellenaghan

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.

kassane avatar Sep 19 '23 15:09 kassane

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…?)

michaellenaghan avatar Sep 19 '23 16:09 michaellenaghan

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 cl flags)

kassane avatar Sep 19 '23 19:09 kassane

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 — cstlor facil or facil.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.

boazsegev avatar Sep 19 '23 21:09 boazsegev

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?

kassane avatar Sep 27 '23 20:09 kassane

The Windows issue will need to refactor the code before we can proceed.

kassane avatar Sep 28 '23 14:09 kassane

@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.

kassane avatar Sep 29 '23 13:09 kassane