diff options
author | Alan Antonuk <aega@med.umich.edu> | 2012-05-17 10:48:16 -0400 |
---|---|---|
committer | Alan Antonuk <aega@med.umich.edu> | 2012-05-17 10:59:19 -0400 |
commit | 538a22cd83807fbcd71ac54b06214ce13ebe2f5c (patch) | |
tree | 668fac53e1cfe39cfc103cb40a5dcff47a13350d /CMakeLists.txt | |
parent | 317f5015c76e4e7c6403bebbfa3d0dda298f0d97 (diff) | |
download | rabbitmq-c-github-ask-538a22cd83807fbcd71ac54b06214ce13ebe2f5c.tar.gz |
Adding option to build rabbitmq-c staticallybuild_static_library
Adding option to the CMake build to build rabbitmq-c
library as a static library.
It is disabled on the WIN32 platform as the amqp.h
header has __declspec(dllimport) statements that need
to be different when using a static library.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7601431..a5615d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) find_package(POPT) +option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON) + +if (WIN32 AND NOT BUILD_SHARED_LIBS) + message(FATAL_ERROR "The rabbitmq-c library cannot be built as a static library on Win32. Set BUILD_SHARED_LIBS=ON to get around this.") +endif() + add_subdirectory(librabbitmq) add_subdirectory(examples) |