-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add bike_sharing profile * clang-format-18 * fix compile errors * clang-format * fix windows mimalloc build * update pkg.cmake
- Loading branch information
Showing
19 changed files
with
697 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,63 @@ | ||
if (NOT DEFINED PROJECT_IS_TOP_LEVEL OR PROJECT_IS_TOP_LEVEL) | ||
find_program(pkg-bin pkg HINTS /opt/pkg) | ||
if (pkg-bin) | ||
message(STATUS "found pkg ${pkg-bin}") | ||
else () | ||
set(pkg-bin "${CMAKE_BINARY_DIR}/dl/pkg") | ||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64") | ||
set(pkg-url "pkg-linux-arm64") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
set(pkg-url "pkg") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | ||
set(pkg-url "pkg.exe") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") | ||
set(pkg-url "pkgosx") | ||
find_program(pkg-bin pkg HINTS /opt/pkg) | ||
if (pkg-bin) | ||
message(STATUS "found pkg ${pkg-bin}") | ||
else () | ||
message(STATUS "Not downloading pkg tool. Using pkg from PATH.") | ||
set(pkg-bin "pkg") | ||
endif () | ||
set(pkg-bin "${CMAKE_BINARY_DIR}/dl/pkg") | ||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64") | ||
set(pkg-url "pkg-linux-arm64") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
set(pkg-url "pkg") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | ||
set(pkg-url "pkg.exe") | ||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") | ||
set(pkg-url "pkgosx") | ||
else () | ||
message(STATUS "Not downloading pkg tool. Using pkg from PATH.") | ||
set(pkg-bin "pkg") | ||
endif () | ||
|
||
if (pkg-url) | ||
if (NOT EXISTS ${pkg-bin}) | ||
message(STATUS "Downloading pkg binary from https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}") | ||
file(DOWNLOAD "https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}" ${pkg-bin}) | ||
if (UNIX) | ||
execute_process(COMMAND chmod +x ${pkg-bin}) | ||
if (pkg-url) | ||
if (NOT EXISTS ${pkg-bin}) | ||
message(STATUS "Downloading pkg binary from https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}") | ||
file(DOWNLOAD "https://github.com/motis-project/pkg/releases/latest/download/${pkg-url}" ${pkg-bin}) | ||
if (UNIX) | ||
execute_process(COMMAND chmod +x ${pkg-bin}) | ||
endif () | ||
else () | ||
message(STATUS "Pkg binary located in project.") | ||
endif () | ||
endif () | ||
else () | ||
message(STATUS "Pkg binary located in project.") | ||
endif () | ||
endif () | ||
endif () | ||
|
||
message(STATUS ${pkg-bin}) | ||
if (DEFINED ENV{GITHUB_ACTIONS}) | ||
message(STATUS "${pkg-bin} -l -h -f") | ||
execute_process( | ||
COMMAND ${pkg-bin} -l -h -f | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
RESULT_VARIABLE pkg-result | ||
) | ||
else () | ||
message(STATUS "${pkg-bin} -l") | ||
execute_process( | ||
COMMAND ${pkg-bin} -l | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
RESULT_VARIABLE pkg-result | ||
) | ||
endif () | ||
|
||
if (DEFINED ENV{GITHUB_ACTIONS}) | ||
execute_process( | ||
COMMAND ${pkg-bin} -l -h | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
) | ||
else () | ||
execute_process( | ||
COMMAND ${pkg-bin} -l | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
) | ||
endif () | ||
endif () | ||
if (NOT pkg-result EQUAL 0) | ||
message(FATAL_ERROR "pkg failed: ${pkg-result}") | ||
endif () | ||
|
||
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps") | ||
add_subdirectory(deps) | ||
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/deps") | ||
add_subdirectory(deps) | ||
endif () | ||
|
||
set_property( | ||
DIRECTORY | ||
APPEND | ||
PROPERTY CMAKE_CONFIGURE_DEPENDS | ||
"${CMAKE_CURRENT_SOURCE_DIR}/.pkg" | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "osr/types.h" | ||
|
||
namespace osr { | ||
|
||
struct additional_edge { | ||
friend bool operator==(additional_edge, additional_edge) = default; | ||
|
||
node_idx_t node_{}; | ||
distance_t distance_{}; | ||
}; | ||
|
||
} // namespace osr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include <cinttypes> | ||
#include <string_view> | ||
|
||
namespace osr { | ||
|
||
enum class mode : std::uint8_t { | ||
kFoot, | ||
kWheelchair, | ||
kBike, | ||
kCar, | ||
}; | ||
|
||
std::string_view to_str(mode); | ||
|
||
} // namespace osr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.