msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.03k stars 883 forks source link

Specify that the project uses only C #1036

Closed dundargoc closed 2 years ago

dundargoc commented 2 years ago

In rare cases, such as using the clang-cl compiler on Windows, the build assumes that the project is both C and C++ based and will give an error if the variable CMAKE_CXX_COMPILER isn't defined. Explicitly stating it's a C project prevents this situation.

Fuzzier commented 2 years ago

The project has a depedency on C++ compiler, since the test component depends on gtest, which is a C++ project. Thus, if the project is set as pure-C, the test component could not be built. gtest does not have a pure-C interface, so it would be hard to refacter the test component into pure-C.

Suggestion: If the main CMakeLists.txt is specified as pure-C, then it shall not call ADD_SUBDIRECTORY (test). test\CMakeLists.txt shall be made a standalone project, and be built by a separate run of cmake.

dundargoc commented 2 years ago

Hmm, the effort needed to fix this was much higher than I anticipated. I don't think the amount of change needed is worth the fix. Closing.