diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4057ac86..f5a97a20 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -143,13 +143,7 @@ if(ENABLE_APP) endif() if(HAVE_NEVERBLEED) - target_include_directories(nghttpx PRIVATE - "${CMAKE_SOURCE_DIR}/third-party/neverbleed" - ) - target_link_libraries(nghttpx - # FIXME .la does not work ofc... - "${CMAKE_BINARY_DIR}/third-party/libneverbleed.la" - ) + target_link_libraries(nghttpx neverbleed) endif() @@ -186,11 +180,10 @@ if(ENABLE_APP) # -L${top_builddir}/third-party/mruby/build/lib @LIBMRUBY_LIBS@ # endif # HAVE_MRUBY # - # if HAVE_NEVERBLEED - # nghttpx_unittest_CPPFLAGS += -I${top_srcdir}/third-party/neverbleed - # nghttpx_unittest_LDADD += ${top_builddir}/third-party/libneverbleed.la - # endif # HAVE_NEVERBLEED - # + if(HAVE_NEVERBLEED) + target_link_libraries(nghttpx-unittest neverbleed) + endif() + add_test(nghttpx-unittest nghttpx-unittest) endif() diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 41308b91..f90a5ee0 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -5,12 +5,15 @@ if(ENABLE_THIRD_PARTY) add_library(http-parser OBJECT ${LIBHTTP_PARSER_SOURCES}) if(HAVE_NEVERBLEED) - set(LIBNEVERBLEED_SOURCES + set(NEVERBLEED_SOURCES neverbleed/neverbleed.c ) - add_library(libneverbleed ${LIBNEVERBLEED_SOURCES}) - target_include_directories(libneverbleed PUBLIC ${OPENSSL_INCLUDE_DIRS}) - target_link_libraries(libneverbleed ${OPENSSL_LIBRARIES}) + add_library(neverbleed ${NEVERBLEED_SOURCES}) + target_include_directories(neverbleed PRIVATE ${OPENSSL_INCLUDE_DIRS}) + target_include_directories(neverbleed INTERFACE + "${CMAKE_SOURCE_DIR}/third-party/neverbleed" + ) + target_link_libraries(neverbleed ${OPENSSL_LIBRARIES}) endif() if(HAVE_MRUBY)