diff --git a/CHANGELOG.md b/CHANGELOG.md index decc3da2f76..9677e130e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - CHANGED: Use Github Actions for building container images [#6138](https://github.com/Project-OSRM/osrm-backend/pull/6138) - CHANGED: Upgrade Boost dependency to 1.70 [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113) - CHANGED: Upgrade Ubuntu CI builds to 20.04 [#6119](https://github.com/Project-OSRM/osrm-backend/pull/6119) + - CHANGED: Make building osrm-routed optional [#6144](https://github.com/Project-OSRM/osrm-backend/pull/6144) # 5.26.0 - Changes from 5.25.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 131db890a22..2fee9b89fb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ option(ENABLE_MASON "Use mason for dependencies" OFF) option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) option(BUILD_TOOLS "Build OSRM tools" OFF) option(BUILD_PACKAGE "Build OSRM package" OFF) +option(BUILD_ROUTED "Build osrm-routed HTTP server" ON) option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF) option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF) option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF) @@ -162,7 +163,11 @@ add_library(CONTRACTOR OBJECT ${ContractorGlob}) add_library(UPDATER OBJECT ${UpdaterGlob}) add_library(STORAGE OBJECT ${StorageGlob}) add_library(ENGINE OBJECT ${EngineGlob}) -add_library(SERVER OBJECT ${ServerGlob}) + +if (BUILD_ROUTED) + add_library(SERVER OBJECT ${ServerGlob}) + add_executable(osrm-routed src/tools/routed.cpp $ $) +endif() set_target_properties(UTIL PROPERTIES LINKER_LANGUAGE CXX) @@ -170,7 +175,6 @@ add_executable(osrm-extract src/tools/extract.cpp) add_executable(osrm-partition src/tools/partition.cpp) add_executable(osrm-customize src/tools/customize.cpp) add_executable(osrm-contract src/tools/contract.cpp) -add_executable(osrm-routed src/tools/routed.cpp $ $) add_executable(osrm-datastore src/tools/store.cpp $ $) add_library(osrm src/osrm/osrm.cpp $ $ $ $) add_library(osrm_contract src/osrm/contractor.cpp $ $) @@ -520,8 +524,12 @@ if(ENABLE_MASON) # expat and bzip2 are used from mason rather than the system include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) else() - - find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + if (BUILD_ROUTED) + # osrm-routed requires newer boost:asio + find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + else() + find_package(Boost 1.60 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + endif() add_dependency_includes(${Boost_INCLUDE_DIRS}) find_package(TBB REQUIRED) @@ -614,7 +622,9 @@ target_link_libraries(osrm-extract osrm_extract ${Boost_PROGRAM_OPTIONS_LIBRARY} target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY}) -target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) +if (BUILD_ROUTED) + target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) +endif() set(EXTRACTOR_LIBRARIES ${BZIP2_LIBRARIES} @@ -719,7 +729,9 @@ set_property(TARGET osrm-extract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-partition PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-contract PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) set_property(TARGET osrm-datastore PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) -set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) +if (BUILD_ROUTED) + set_property(TARGET osrm-routed PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() file(GLOB VariantGlob third_party/variant/include/mapbox/*.hpp) file(GLOB FlatbuffersGlob third_party/flatbuffers/include/flatbuffers/*.h) @@ -748,7 +760,9 @@ install(TARGETS osrm-partition DESTINATION bin) install(TARGETS osrm-customize DESTINATION bin) install(TARGETS osrm-contract DESTINATION bin) install(TARGETS osrm-datastore DESTINATION bin) -install(TARGETS osrm-routed DESTINATION bin) +if (BUILD_ROUTED) + install(TARGETS osrm-routed DESTINATION bin) +endif() install(TARGETS osrm DESTINATION lib) install(TARGETS osrm_extract DESTINATION lib) install(TARGETS osrm_partition DESTINATION lib) diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 86a5297e5d7..cf2ece5c00b 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -114,10 +114,12 @@ add_executable(library-partition-tests EXCLUDE_FROM_ALL ${LibraryPartitionTestsSources}) -add_executable(server-tests +if (BUILD_ROUTED) + add_executable(server-tests EXCLUDE_FROM_ALL ${ServerTestsSources} $ $) +endif() add_executable(util-tests EXCLUDE_FROM_ALL @@ -170,7 +172,9 @@ target_link_libraries(library-extract-tests osrm_extract osrm_guidance ${Boost_U target_link_libraries(library-contract-tests osrm_contract ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(library-customize-tests osrm_customize ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(library-partition-tests osrm_partition ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -target_link_libraries(server-tests osrm ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +if (BUILD_ROUTED) + target_link_libraries(server-tests osrm ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +endif() target_link_libraries(util-tests ${UTIL_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(contractor-tests osrm_contract ${CONTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) target_link_libraries(storage-tests osrm_store ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})