Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor more cpp #122

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dumper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${dist_dir}/dumper)

add_executable(cose_dumper dumper.c)
add_executable(cose_dumper dumper.cpp)
target_link_libraries(cose_dumper PRIVATE cn-cbor::cn-cbor cose-c::cose-c)
if(MSVC)
target_link_libraries(cose_dumper PRIVATE ws2_32)
endif()

target_include_directories(cose_dumper PRIVATE ../src)
target_compile_options(cose_dumper PRIVATE "-fpermissive")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we are using cpp, we can overload functions -> we should get rid if macros that insert , context to the argument list IMHO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not going to be possible to remove all of these macros as the CBOR library is still in C. I am also not too sure how much one can rely on linkers to not require functions exist, I know that one can compile each function into a separate block for MSVC but I don't know for sure that this exists in gcc and clang as they are not the compilers that I use much


if(COSE_C_USE_MBEDTLS)
# mbedtls
Expand All @@ -20,5 +21,5 @@ else()
endif()

if(CLANG_TIDY_EXE)
set_target_properties(cose_dumper PROPERTIES C_CLANG_TIDY "${CLANG_TIDY_EXE}")
set_target_properties(cose_dumper PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
endif()
Loading