Skip to content

Commit 00565a7

Browse files
authored
Remove separate osrm_guidance library, fixes #6954 (#7315)
* Remove separate osrm_guidance library, fixes #6954 * Add changelog entry * Fix comment
1 parent 9dbb8a1 commit 00565a7

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Build:
44
- FIXED: Update Node.js binding path from `lib/binding` to `lib/binding_napi_v8` to match node-pre-gyp versioning conventions [#7272](https://github.com/Project-OSRM/osrm-backend/pull/7272)
55
- FIXED: Reduce MSVC compiler warnings by suppressing informational warnings while preserving bug-indicating warnings [#7253](https://github.com/Project-OSRM/osrm-backend/issues/7253)
6+
- FIXED: Merge `osrm_extract` and `osrm_guidance` to avoid circular dependencies. [#7315](https://github.com/Project-OSRM/osrm-backend/pull/7315)
67
- FIXED: Work around compilation error due to a false-positive of array-bounds check in sol2 [#7317](https://github.com/Project-OSRM/osrm-backend/pull/7317)
78
- Misc:
89
- ADDED: `SHM_LOCK_DIR` environment variable for shared memory lock file directory [#7312](https://github.com/Project-OSRM/osrm-backend/pull/7312)

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ file(GLOB ServerGlob src/server/*.cpp src/server/**/*.cpp)
160160
file(GLOB EngineGlob src/engine/*.cpp src/engine/**/*.cpp)
161161

162162
add_library(UTIL OBJECT ${UtilGlob})
163-
add_library(EXTRACTOR OBJECT ${ExtractorGlob})
164-
add_library(GUIDANCE OBJECT ${GuidanceGlob})
163+
# For historical reason the guidance and extract code are separate.
164+
# They are so entangled though (circular dependencies) that separate libraries are not feasible.
165+
add_library(EXTRACTOR OBJECT ${ExtractorGlob} ${GuidanceGlob})
165166
add_library(PARTITIONER OBJECT ${PartitionerGlob})
166167
add_library(CUSTOMIZER OBJECT ${CustomizerGlob})
167168
add_library(CONTRACTOR OBJECT ${ContractorGlob})
@@ -181,7 +182,6 @@ add_executable(osrm-datastore src/tools/store.cpp $<TARGET_OBJECTS:MICROTAR> $<T
181182
add_library(osrm src/osrm/osrm.cpp $<TARGET_OBJECTS:ENGINE> $<TARGET_OBJECTS:STORAGE> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
182183
add_library(osrm_contract src/osrm/contractor.cpp $<TARGET_OBJECTS:CONTRACTOR> $<TARGET_OBJECTS:UTIL>)
183184
add_library(osrm_extract src/osrm/extractor.cpp $<TARGET_OBJECTS:EXTRACTOR> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
184-
add_library(osrm_guidance $<TARGET_OBJECTS:GUIDANCE> $<TARGET_OBJECTS:UTIL>)
185185
add_library(osrm_partition src/osrm/partitioner.cpp $<TARGET_OBJECTS:PARTITIONER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
186186
add_library(osrm_customize src/osrm/customizer.cpp $<TARGET_OBJECTS:CUSTOMIZER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
187187
add_library(osrm_update $<TARGET_OBJECTS:UPDATER> $<TARGET_OBJECTS:MICROTAR> $<TARGET_OBJECTS:UTIL>)
@@ -483,12 +483,6 @@ set(EXTRACTOR_LIBRARIES
483483
${TBB_LIBRARIES}
484484
${ZLIB_LIBRARY}
485485
${MAYBE_COVERAGE_LIBRARIES})
486-
set(GUIDANCE_LIBRARIES
487-
${BOOST_BASE_LIBRARIES}
488-
${CMAKE_THREAD_LIBS_INIT}
489-
${LUA_LIBRARIES}
490-
${TBB_LIBRARIES}
491-
${MAYBE_COVERAGE_LIBRARIES})
492486
set(PARTITIONER_LIBRARIES
493487
${BOOST_ENGINE_LIBRARIES}
494488
${CMAKE_THREAD_LIBS_INIT}
@@ -540,7 +534,7 @@ set(UTIL_LIBRARIES
540534
target_link_libraries(osrm ${ENGINE_LIBRARIES})
541535
target_link_libraries(osrm_update ${UPDATER_LIBRARIES})
542536
target_link_libraries(osrm_contract ${CONTRACTOR_LIBRARIES} osrm_update osrm_store)
543-
target_link_libraries(osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES})
537+
target_link_libraries(osrm_extract ${EXTRACTOR_LIBRARIES})
544538
target_link_libraries(osrm_partition ${PARTITIONER_LIBRARIES})
545539
target_link_libraries(osrm_customize ${CUSTOMIZER_LIBRARIES} osrm_update osrm_store)
546540
target_link_libraries(osrm_store ${STORAGE_LIBRARIES})
@@ -607,7 +601,6 @@ install(TARGETS osrm_customize DESTINATION lib)
607601
install(TARGETS osrm_update DESTINATION lib)
608602
install(TARGETS osrm_contract DESTINATION lib)
609603
install(TARGETS osrm_store DESTINATION lib)
610-
install(TARGETS osrm_guidance DESTINATION lib)
611604

612605
# Install profiles and support library to /usr/local/share/osrm/profiles by default
613606
set(DefaultProfilesDir profiles)

unit_tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ target_include_directories(contractor-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
160160
target_include_directories(storage-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
161161

162162
target_link_libraries(engine-tests ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
163-
target_link_libraries(extractor-tests osrm_extract osrm_guidance ${EXTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
163+
target_link_libraries(extractor-tests osrm_extract ${EXTRACTOR_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
164164
target_link_libraries(partitioner-tests osrm_partition ${PARTITIONER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
165165
target_link_libraries(customizer-tests osrm_customize ${CUSTOMIZER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
166166
target_link_libraries(updater-tests osrm_update ${UPDATER_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
167167
target_link_libraries(library-tests osrm ${ENGINE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
168-
target_link_libraries(library-extract-tests osrm_extract osrm_guidance ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
168+
target_link_libraries(library-extract-tests osrm_extract ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
169169
target_link_libraries(library-contract-tests osrm_contract ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
170170
target_link_libraries(library-customize-tests osrm_customize ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
171171
target_link_libraries(library-partition-tests osrm_partition ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

0 commit comments

Comments
 (0)