@@ -35,6 +35,7 @@ option(ENABLE_LTO "Use LTO if available" OFF)
3535option (ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF )
3636option (ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF )
3737option (ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF )
38+ option (USE_64BIT_IDS "Whether to use 64-bit node and edge IDs" OFF )
3839
3940if (ENABLE_CLANG_TIDY)
4041 find_program (CLANG_TIDY_COMMAND NAMES clang-tidy)
@@ -89,6 +90,13 @@ else()
8990 add_definitions (-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR} " )
9091endif ()
9192
93+ if (USE_64BIT_IDS)
94+ add_definitions (-DUSE_64BIT_IDS)
95+ message (STATUS "Using 64-bit node and edge IDs" )
96+ else ()
97+ message (STATUS "Using 32-bit node and edge IDs" )
98+ endif ()
99+
92100# these two functions build up custom variables:
93101# DEPENDENCIES_INCLUDE_DIRS and OSRM_DEFINES
94102# These variables we want to pass to
@@ -151,7 +159,7 @@ add_library(UPDATER OBJECT ${UpdaterGlob})
151159add_library (STORAGE OBJECT ${StorageGlob} )
152160add_library (ENGINE OBJECT ${EngineGlob} )
153161
154- if (BUILD_ROUTED)
162+ if (BUILD_ROUTED)
155163 add_library (SERVER OBJECT ${ServerGlob} )
156164 add_executable (osrm-routed src/tools/routed.cpp $<TARGET_OBJECTS:SERVER> $<TARGET_OBJECTS:UTIL>)
157165endif ()
@@ -309,7 +317,7 @@ add_subdirectory(${FLATBUFFERS_SRC_DIR}
309317set (FMT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /third_party/fmt-9.1.0/include" )
310318add_compile_definitions (FMT_HEADER_ONLY)
311319include_directories (SYSTEM ${FMT_INCLUDE_DIR} )
312-
320+
313321
314322# see https://stackoverflow.com/questions/70898030/boost-link-error-using-conan-find-package
315323if (MSVC )
@@ -319,7 +327,7 @@ endif()
319327if (ENABLE_CONAN)
320328 message (STATUS "Installing dependencies via Conan" )
321329
322- # Conan will generate Find*.cmake files to build directory, so we use them with the highest priority
330+ # Conan will generate Find*.cmake files to build directory, so we use them with the highest priority
323331 list (INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR} )
324332 list (INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_BINARY_DIR} )
325333
@@ -330,26 +338,26 @@ if(ENABLE_CONAN)
330338 set (CONAN_EXPAT_VERSION "2.2.10#916908d4a570ad839edd25322c3268cd" )
331339 set (CONAN_LUA_VERSION "5.4.4#3ec62efc37cd0a5d80b9e5cb35277360" )
332340 set (CONAN_TBB_VERSION "2021.3.0#507ec17cbd51a84167e143b20d170eea" )
333-
341+
334342 set (CONAN_SYSTEM_INCLUDES ON )
335343
336- # TODO:
337- # if we link TBB dynamically osrm-extract.exe finishes on the first access to any TBB symbol
344+ # TODO:
345+ # if we link TBB dynamically osrm-extract.exe finishes on the first access to any TBB symbol
338346 # with exit code = -1073741515, which means that program cannot load required DLL.
339347 if (MSVC )
340348 set (TBB_SHARED False )
341349 else ()
342350 set (TBB_SHARED True )
343351 endif ()
344352
345- set (CONAN_ARGS
346- REQUIRES
353+ set (CONAN_ARGS
354+ REQUIRES
347355 "boost/${CONAN_BOOST_VERSION} "
348356 "bzip2/${CONAN_BZIP2_VERSION} "
349357 "expat/${CONAN_EXPAT_VERSION} "
350358 "lua/${CONAN_LUA_VERSION} "
351359 "onetbb/${CONAN_TBB_VERSION} "
352- BASIC_SETUP
360+ BASIC_SETUP
353361 GENERATORS cmake_find_package json # json generator generates a conanbuildinfo.json in the build folder so (non-CMake) projects can easily parse OSRM's dependencies
354362 KEEP_RPATHS
355363 NO_OUTPUT_DIRS
@@ -386,7 +394,7 @@ if(ENABLE_CONAN)
386394 set (Boost_ZLIB_LIBRARY "${Boost_zlib_LIB_TARGETS} " )
387395 set (Boost_REGEX_LIBRARY "${Boost_regex_LIB_TARGETS} " )
388396 set (Boost_UNIT_TEST_FRAMEWORK_LIBRARY "${Boost_unit_test_framework_LIB_TARGETS} " )
389-
397+
390398
391399 find_package (BZip2 REQUIRED)
392400 find_package (EXPAT REQUIRED)
@@ -730,23 +738,23 @@ if (ENABLE_FUZZING)
730738 add_subdirectory (fuzz)
731739endif ()
732740
733- # add headers sanity check target that includes all headers independently
734- set (check_headers_dir "${PROJECT_BINARY_DIR} /check-headers" )
735- file (GLOB_RECURSE headers_to_check
736- ${PROJECT_BINARY_DIR} /*.hpp
737- ${PROJECT_SOURCE_DIR} /include /*.hpp)
738- foreach (header ${headers_to_check} )
741+ # add headers sanity check target that includes all headers independently
742+ set (check_headers_dir "${PROJECT_BINARY_DIR} /check-headers" )
743+ file (GLOB_RECURSE headers_to_check
744+ ${PROJECT_BINARY_DIR} /*.hpp
745+ ${PROJECT_SOURCE_DIR} /include /*.hpp)
746+ foreach (header ${headers_to_check} )
739747 if ("${header} " MATCHES ".*/include/nodejs/.*" )
740748 # we do not check NodeJS bindings headers
741749 continue ()
742750 endif ()
743- get_filename_component (filename ${header} NAME_WE )
744- set (filename "${check_headers_dir} /${filename} .cpp" )
745- if (NOT EXISTS ${filename} )
746- file (WRITE ${filename} "#include \" ${header} \"\n " )
747- endif ()
748- list (APPEND sources ${filename} )
749- endforeach ()
750- add_library (check-headers STATIC EXCLUDE_FROM_ALL ${sources} )
751- set_target_properties (check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir} )
751+ get_filename_component (filename ${header} NAME_WE )
752+ set (filename "${check_headers_dir} /${filename} .cpp" )
753+ if (NOT EXISTS ${filename} )
754+ file (WRITE ${filename} "#include \" ${header} \"\n " )
755+ endif ()
756+ list (APPEND sources ${filename} )
757+ endforeach ()
758+ add_library (check-headers STATIC EXCLUDE_FROM_ALL ${sources} )
759+ set_target_properties (check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir} )
752760
0 commit comments