diff options
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c067284..bef5262 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,7 +224,7 @@ 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) +option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ON) option(BUILD_EXAMPLES "Build Examples" ON) option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND}) @@ -278,6 +278,11 @@ if (BUILD_TOOLS) endif () if (BUILD_TESTS) + if (NOT BUILD_STATIC_LIBS) + message(FATAL_ERROR + "Tests can only be built against static libraries " + "(set BUILD_STATIC_LIBS=ON)") + endif () enable_testing() add_subdirectory(tests) endif (BUILD_TESTS) diff --git a/Makefile.am b/Makefile.am index 5ca61ad..3ffda6f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,17 +84,17 @@ check_PROGRAMS = \ TESTS = $(check_PROGRAMS) tests_test_tables_SOURCES = tests/test_tables.c -tests_test_tables_LDADD = librabbitmq/librabbitmq.la +tests_test_tables_LDADD = librabbitmq/librabbitmq.a tests_test_parse_url_SOURCES = tests/test_parse_url.c -tests_test_parse_url_LDADD = librabbitmq/librabbitmq.la +tests_test_parse_url_LDADD = librabbitmq/librabbitmq.a tests_test_hostcheck_SOURCES = \ tests/test_hostcheck.c \ librabbitmq/amqp_hostcheck.c tests_test_status_enum_SOURCES = tests/test_status_enum.c -tests_test_status_enum_LDADD = librabbitmq/librabbitmq.la +tests_test_status_enum_LDADD = librabbitmq/librabbitmq.a noinst_LTLIBRARIES = diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c8d96d7..fca99fc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,11 +11,11 @@ endif (MSVC) add_definitions(-DHAVE_CONFIG_H) add_executable(test_parse_url test_parse_url.c) -target_link_libraries(test_parse_url ${RMQ_LIBRARY_TARGET}) +target_link_libraries(test_parse_url rabbitmq-static) add_test(parse_url test_parse_url) add_executable(test_tables test_tables.c) -target_link_libraries(test_tables ${RMQ_LIBRARY_TARGET}) +target_link_libraries(test_tables rabbitmq-static) add_test(tables test_tables) configure_file(test_tables.expected ${CMAKE_CURRENT_BINARY_DIR}/tests/test_tables.expected COPY_ONLY) @@ -26,5 +26,5 @@ add_test(hostcheck test_hostcheck) add_executable(test_status_enum test_status_enum.c) -target_link_libraries(test_status_enum ${RMQ_LIBRARY_TARGET}) +target_link_libraries(test_status_enum rabbitmq-static) add_test(status_enum test_status_enum) |