MacOS/Cmake Supplied-JWT Linker Error
Opened this issue · 3 comments
Hi,
I've been attempting to building on MacOS, with the NMOS_CPP_USE_SUPPLIED_JWT_CPP flag to true, causes Linking CXX static library libjwt-cpp.a
Error
Assuming Boost/cpprestsdk are installed,
To Replicate:
cmake -B build -DNMOS_CPP_USE_SUPPLIED_JWT_CPP=TRUE -DNMOS_CPP_USE_SUPPLIED_JSON_SCHEMA_VALIDATOR=TRUE -DWEBSOCKETPP_INCLUDE_DIR="Release/libs/websocketpp"
cmake --build build
Thanks
It looks like the section in NmosCppDependencies.cmake
that compiles this creates a static library for a header only library. It even has a comment # hm, header-only so should be INTERFACE library?
I've checked and confirmed NMOS_CPP_USE_SUPPLIED_JSON_SCHEMA_VALIDATOR
works OK on Linux... it constructs an empty libjwt-cpp.a (8 Byte file). I suspect difference in behaviour with empty archives on macOS. The CI matrix only tests this flag on one platform. As the original author of the "hm" comment after the library was first added, I agree an INTERFACE
library would be more elegant anyway... but I note one or two other potential issues - I think missing install(FILES)
and I think wrong target_include_directories
. I'll look at this when I get a chance.
I believe that is exactly the case, MacOS fails on an empty archive. Thanks for getting back to me!