cmake: rename nghttpx-bin target to nghttpx

`ninja nghttpx` would create the static library, but I expected a binary
`nghttpx` instead. Rename the nghttpx target to nghttpx_static and
nghttpx-bin to nghttpx.
This commit is contained in:
Peter Wu 2016-02-18 14:20:35 +01:00
parent 9ab5ef3b5b
commit 9c874bf9b5
1 changed files with 9 additions and 10 deletions

View File

@ -124,23 +124,23 @@ if(ENABLE_APP)
shrpx_mruby_module_response.cc shrpx_mruby_module_response.cc
) )
endif() endif()
add_library(nghttpx STATIC ${NGHTTPX_SRCS}) add_library(nghttpx_static STATIC ${NGHTTPX_SRCS})
set_target_properties(nghttpx_static PROPERTIES ARCHIVE_OUTPUT_NAME nghttpx)
set(NGHTTPX-bin_SOURCES set(NGHTTPX-bin_SOURCES
shrpx.cc shrpx.cc
) )
if(HAVE_MRUBY) if(HAVE_MRUBY)
target_link_libraries(nghttpx mruby-lib) target_link_libraries(nghttpx_static mruby-lib)
endif() endif()
if(HAVE_NEVERBLEED) if(HAVE_NEVERBLEED)
target_link_libraries(nghttpx neverbleed) target_link_libraries(nghttpx_static neverbleed)
endif() endif()
if(HAVE_CUNIT) if(HAVE_CUNIT)
# check_PROGRAMS += nghttpx-unittest
set(NGHTTPX_UNITTEST_SOURCES set(NGHTTPX_UNITTEST_SOURCES
shrpx-unittest.cc shrpx-unittest.cc
shrpx_ssl_test.cc shrpx_ssl_test.cc
@ -164,7 +164,7 @@ if(ENABLE_APP)
target_compile_definitions(nghttpx-unittest target_compile_definitions(nghttpx-unittest
PRIVATE "-DNGHTTP2_TESTS_DIR=\"${CMAKE_SOURCE_DIR}/tests\"" PRIVATE "-DNGHTTP2_TESTS_DIR=\"${CMAKE_SOURCE_DIR}/tests\""
) )
target_link_libraries(nghttpx-unittest nghttpx ${CUNIT_LIBRARIES}) target_link_libraries(nghttpx-unittest nghttpx_static ${CUNIT_LIBRARIES})
if(HAVE_MRUBY) if(HAVE_MRUBY)
target_link_libraries(nghttpx-unittest mruby-lib) target_link_libraries(nghttpx-unittest mruby-lib)
endif() endif()
@ -177,13 +177,12 @@ if(ENABLE_APP)
add_executable(nghttp ${NGHTTP_SOURCES} $<TARGET_OBJECTS:http-parser>) add_executable(nghttp ${NGHTTP_SOURCES} $<TARGET_OBJECTS:http-parser>)
add_executable(nghttpd ${NGHTTPD_SOURCES} $<TARGET_OBJECTS:http-parser>) add_executable(nghttpd ${NGHTTPD_SOURCES} $<TARGET_OBJECTS:http-parser>)
add_executable(nghttpx-bin ${NGHTTPX-bin_SOURCES} $<TARGET_OBJECTS:http-parser>) add_executable(nghttpx ${NGHTTPX-bin_SOURCES} $<TARGET_OBJECTS:http-parser>)
target_compile_definitions(nghttpx-bin PRIVATE "-DPKGDATADIR=\"${PKGDATADIR}\"") target_compile_definitions(nghttpx PRIVATE "-DPKGDATADIR=\"${PKGDATADIR}\"")
set_target_properties(nghttpx-bin PROPERTIES OUTPUT_NAME nghttpx) target_link_libraries(nghttpx nghttpx_static)
target_link_libraries(nghttpx-bin nghttpx)
add_executable(h2load ${H2LOAD_SOURCES} $<TARGET_OBJECTS:http-parser>) add_executable(h2load ${H2LOAD_SOURCES} $<TARGET_OBJECTS:http-parser>)
install(TARGETS nghttp nghttpd nghttpx-bin h2load install(TARGETS nghttp nghttpd nghttpx h2load
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif() endif()