Fixed BUILD_SHARED_LIBS meaning.

There are three switches to build static/shared libraries.

Here is the logic.

If BUILD_SHARED_LIBS is defined
   If BUILD_SHARED_LIBS is ON
      build only shared-library
   Else
      build only static-library
   Endif
Else
   If MSGPACK_ENABLE_SHARED is ON (default)
      build shared-library
   Endif
   If MSGPACK_ENABLE_STATIC is ON (default)
      build static-library
   Endif
Endif

Here is common settings:

If you want to build both static/shared libraries, don't set switches.
If you want to build only shared-library, set BUILD_SHARED_LIBS=ON.
If you want to build only static-library, set BUILD_SHARED_LIBS=OFF.
This commit is contained in:
Takatoshi Kondo
2018-08-15 16:39:21 +09:00
parent 3a615bcf44
commit b804e12dec
2 changed files with 34 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
IF (BUILD_SHARED_LIBS OR MSGPACK_ENABLE_SHARED)
IF (MSGPACK_ENABLE_SHARED)
SET (MSGPACK_LIB msgpackc)
ENDIF ()