updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@ -6,15 +6,7 @@ if(PROJECT_ENABLE_SPDLOG)
|
|||||||
|
|
||||||
include_directories(BEFORE SYSTEM ${SPDLOG_INCLUDE_DIRS})
|
include_directories(BEFORE SYSTEM ${SPDLOG_INCLUDE_DIRS})
|
||||||
|
|
||||||
if(PROJECT_IS_MINGW_UNIX)
|
|
||||||
if(PROJECT_STATIC_LINK)
|
|
||||||
link_libraries(/mingw64/lib/libspdlog.a)
|
|
||||||
else()
|
|
||||||
link_libraries(/mingw64/lib/libspdlog.dll.a)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
link_libraries(spdlog::spdlog)
|
link_libraries(spdlog::spdlog)
|
||||||
endif()
|
|
||||||
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
elseif(NOT PROJECT_IS_MINGW OR CMAKE_HOST_WIN32)
|
||||||
ExternalProject_Add(spdlog_project
|
ExternalProject_Add(spdlog_project
|
||||||
PREFIX external
|
PREFIX external
|
||||||
@ -23,7 +15,6 @@ if(PROJECT_ENABLE_SPDLOG)
|
|||||||
LIST_SEPARATOR |
|
LIST_SEPARATOR |
|
||||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||||
-DBUILD_STATIC_LIBS=ON
|
|
||||||
-DSPDLOG_BUILD_EXAMPLE=OFF
|
-DSPDLOG_BUILD_EXAMPLE=OFF
|
||||||
-DSPDLOG_FMT_EXTERNAL=OFF
|
-DSPDLOG_FMT_EXTERNAL=OFF
|
||||||
-DSPDLOG_FMT_EXTERNAL_HO=OFF
|
-DSPDLOG_FMT_EXTERNAL_HO=OFF
|
||||||
|
@ -570,8 +570,7 @@ RUN if [ -f "/3rd_party/spdlog-${MY_SPDLOG_VERSION}.tar.gz" ]; then \
|
|||||||
&& cd build \
|
&& cd build \
|
||||||
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
&& cmake .. -DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||||
-DSPDLOG_BUILD_SHARED=ON \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-DSPDLOG_BUILD_STATIC=ON \
|
|
||||||
-DSPDLOG_BUILD_EXAMPLE=OFF \
|
-DSPDLOG_BUILD_EXAMPLE=OFF \
|
||||||
-DSPDLOG_FMT_EXTERNAL=OFF \
|
-DSPDLOG_FMT_EXTERNAL=OFF \
|
||||||
-DSPDLOG_FMT_EXTERNAL_HO=OFF \
|
-DSPDLOG_FMT_EXTERNAL_HO=OFF \
|
||||||
|
@ -271,16 +271,12 @@ template <typename string_t>
|
|||||||
}
|
}
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
|
format_path(api_path, slash_t, backslash_t);
|
||||||
|
|
||||||
while (utils::string::begins_with(api_path, dot_slash_t)) {
|
while (utils::string::begins_with(api_path, dot_slash_t)) {
|
||||||
api_path = api_path.substr(dot_slash_t.size());
|
api_path = api_path.substr(dot_slash_t.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
while (utils::string::begins_with(api_path, dot_t)) {
|
|
||||||
api_path = api_path.substr(dot_t.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
format_path(api_path, slash_t, backslash_t);
|
|
||||||
|
|
||||||
if (api_path.at(0U) != slash_t.at(0U)) {
|
if (api_path.at(0U) != slash_t.at(0U)) {
|
||||||
return string_t{slash_t} + api_path;
|
return string_t{slash_t} + api_path;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ auto file::open_file(std::filesystem::path path, bool read_only) -> file {
|
|||||||
auto file::open_or_create_file(std::filesystem::path path,
|
auto file::open_or_create_file(std::filesystem::path path,
|
||||||
bool read_only) -> file {
|
bool read_only) -> file {
|
||||||
path = utils::path::absolute(path.string());
|
path = utils::path::absolute(path.string());
|
||||||
|
if (not utils::file::is_file(path.string())) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
int old_mode{};
|
int old_mode{};
|
||||||
_umask_s(077, &old_mode);
|
_umask_s(077, &old_mode);
|
||||||
@ -133,6 +133,7 @@ auto file::open_or_create_file(std::filesystem::path path,
|
|||||||
if (ptr != nullptr) {
|
if (ptr != nullptr) {
|
||||||
fclose(ptr);
|
fclose(ptr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return open_file(path, read_only);
|
return open_file(path, read_only);
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,13 @@ TEST(utils_path, combine) {
|
|||||||
EXPECT_STREQ("/test/path/again", s.c_str());
|
EXPECT_STREQ("/test/path/again", s.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
s = utils::path::combine("/home/test/.dest", {".state"});
|
||||||
|
#if defined(_WIN32)
|
||||||
|
EXPECT_STREQ("\\home\\test\\.dest\\.state", s.c_str());
|
||||||
|
#else
|
||||||
|
EXPECT_STREQ("/home/test/.dest/.state", s.c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
s = utils::path::combine(R"(R:\test)", {R"(\path)", R"(\again\)"});
|
s = utils::path::combine(R"(R:\test)", {R"(\path)", R"(\again\)"});
|
||||||
EXPECT_STREQ(R"(r:\test\path\again)", s.c_str());
|
EXPECT_STREQ(R"(r:\test\path\again)", s.c_str());
|
||||||
@ -200,6 +207,15 @@ TEST(utils_path, create_api_path) {
|
|||||||
|
|
||||||
s = utils::path::create_api_path("/cow\\\\/moose\\\\/\\dog\\chicken\\");
|
s = utils::path::create_api_path("/cow\\\\/moose\\\\/\\dog\\chicken\\");
|
||||||
EXPECT_STREQ("/cow/moose/dog/chicken", s.c_str());
|
EXPECT_STREQ("/cow/moose/dog/chicken", s.c_str());
|
||||||
|
|
||||||
|
s = utils::path::create_api_path(".state");
|
||||||
|
EXPECT_STREQ("/.state", s.c_str());
|
||||||
|
|
||||||
|
s = utils::path::create_api_path("/.state/.local");
|
||||||
|
EXPECT_STREQ("/.state/.local", s.c_str());
|
||||||
|
|
||||||
|
s = utils::path::create_api_path("./.state/.local");
|
||||||
|
EXPECT_STREQ("/.state/.local", s.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(utils_path, finalize) {
|
TEST(utils_path, finalize) {
|
||||||
|
Reference in New Issue
Block a user