From 538a22cd83807fbcd71ac54b06214ce13ebe2f5c Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Thu, 17 May 2012 10:48:16 -0400 Subject: Adding option to build rabbitmq-c statically 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. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.1