diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2015-03-22 21:17:00 -0700 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2015-03-22 21:17:00 -0700 |
commit | 96ddcc86bd43863f3b3fc4163745b1e3a7b6d72d (patch) | |
tree | b5809eeca8598bb5f6b4c99acc8e1674266a011f | |
parent | 8b37d449433f6c7c52ab38d0165b9a01f0b029a3 (diff) | |
download | rabbitmq-c-ios_build.tar.gz |
CMake: default to static libs on iOSios_build
Its not possible to build a dynamic library on iOS.
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d0c3ba..4f70369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,8 +228,16 @@ endif() find_package(Threads) -option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON) -option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" OFF) +set(_DEFAULT_BUILD_SHARED ON) +set(_DEFAULT_BUILD_STATIC OFF) + +if (IOS) + set(_DEFAULT_BUILD_SHARED OFF) + set(_DEFAULT_BUILD_STATIC ON) +endif() + +option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ${_DEFAULT_BUILD_SHARED}) +option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ${_DEFAULT_BUILD_STATIC}) option(BUILD_EXAMPLES "Build Examples" ON) option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND}) @@ -265,7 +273,10 @@ if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) endif() if (WIN32 AND BUILD_STATIC_LIBS) - message(FATAL_ERROR "The rabbitmq-c library cannot be built as a static library on Win32. Set BUILD_STATIC_LIBS=OFF to get around this.") + message(FATAL_ERROR "rabbitmq-c cannot be built as a static library on Win32. Set BUILD_STATIC_LIBS=OFF to build.") +endif() +if (IOS AND BUILD_SHARED_LIBS) + message(FATAL_ERROR "rabbitmq-c cannot be built as a shared library on iOS. Set BUILD_SHARED_LIBS=OFF to build.") endif() add_subdirectory(librabbitmq) |