Compare commits

..

3 Commits

Author SHA1 Message Date
Takatoshi Kondo
8160ede5e2 Update README.md. 2023-03-04 22:43:04 +09:00
Takatoshi Kondo
6e8503f1c0 Merge pull request #1055 from dundargoc/build/only-c
Explicitly specify the project is a C project if tests aren't used.
2023-03-04 22:39:01 +09:00
dundargoc
2f543923d2 Explicitly specify the project is a C project.
CMake assumes the default project uses both C and C++, and therefore
will fail if both a C and a C++ compiler isn't found. This essentially
blocks pure C projects from using msgpack-c if they also don't have a
C++ compiler.

Just specifying that the project is "C" isn't possible though, as the
test themselves use C++. The workaround here is that we specify the
project needs both a C and C++ compiler if tests are used, but only a C
compiler if the tests aren't used.
2023-03-04 13:41:42 +01:00
2 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
# 2023-02-28 version 6.0.0
# 2023-03-02 version 6.0.0
* Remove C++ requirement if test is disabled (#1055)
## << breaking changes >>
* Change CMake package name of C library to msgpack-c (#1053)
Unified all C package, library, cmake, tarball name become msgpack-c.

View File

@@ -5,7 +5,14 @@ IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
CMAKE_POLICY(SET CMP0054 NEW)
ENDIF ()
OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." ON)
OPTION (MSGPACK_GEN_COVERAGE "Enable running gcov to get a test coverage report." OFF)
if(MSGPACK_BUILD_TESTS)
PROJECT (msgpack-c)
else()
PROJECT (msgpack-c C)
endif()
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.h contents)
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
@@ -74,14 +81,6 @@ IF (MSGPACK_CHAR_SIGN)
SET (CMAKE_C_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_C_FLAGS}")
ENDIF ()
FIND_PACKAGE (GTest)
FIND_PACKAGE (ZLIB)
FIND_PACKAGE (Threads)
IF (GTEST_FOUND AND ZLIB_FOUND AND THREADS_FOUND)
OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." ON)
OPTION (MSGPACK_GEN_COVERAGE "Enable running gcov to get a test coverage report." OFF)
ENDIF ()
IF (DEFINED BUILD_SHARED_LIBS)
IF (BUILD_SHARED_LIBS)
IF (DEFINED MSGPACK_ENABLE_SHARED AND NOT MSGPACK_ENABLE_SHARED)