mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
[win32] use boost filesystem for gcc builds
Some checks failed
Build Debian packages / ${{ matrix.dist }} (bookworm) (push) Has been cancelled
Build Debian packages / ${{ matrix.dist }} (bullseye) (push) Has been cancelled
Build Debian packages / ${{ matrix.dist }} (buster) (push) Has been cancelled
Build on FreeBSD / with UPnP (push) Has been cancelled
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (no) (push) Has been cancelled
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Has been cancelled
Build on Windows / XP (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (no) (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (OFF) (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (ON) (push) Has been cancelled
Some checks failed
Build Debian packages / ${{ matrix.dist }} (bookworm) (push) Has been cancelled
Build Debian packages / ${{ matrix.dist }} (bullseye) (push) Has been cancelled
Build Debian packages / ${{ matrix.dist }} (buster) (push) Has been cancelled
Build on FreeBSD / with UPnP (push) Has been cancelled
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (no) (push) Has been cancelled
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Has been cancelled
Build on Windows / ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Has been cancelled
Build on Windows / CMake ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Has been cancelled
Build on Windows / XP (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (no) (push) Has been cancelled
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (OFF) (push) Has been cancelled
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (ON) (push) Has been cancelled
Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
parent
d7c4d0ff3e
commit
7c78da1336
|
@ -15,7 +15,7 @@ ifeq ($(shell expr match $(CXX) 'clang'),5)
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
else ifeq ($(shell expr match ${CXXVER} "7"),1) # gcc 7
|
else ifeq ($(shell expr match ${CXXVER} "7"),1) # gcc 7
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
LDLIBS = -lboost_filesystem
|
LDLIBS = -lboost_filesystem
|
||||||
else ifeq ($(shell expr match ${CXXVER} "[8-9]"),1) # gcc 8 - 9
|
else ifeq ($(shell expr match ${CXXVER} "[8-9]"),1) # gcc 8 - 9
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
LDLIBS = -lstdc++fs
|
LDLIBS = -lstdc++fs
|
||||||
|
|
|
@ -7,7 +7,7 @@ CXXFLAGS := $(CXX_DEBUG) -fPIC -msse
|
||||||
INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
|
INCFLAGS := -I$(DAEMON_SRC_DIR) -IWin32
|
||||||
LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
|
LDFLAGS := ${LD_DEBUG} -static -fPIC -msse
|
||||||
|
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++20
|
||||||
DEFINES += -DWIN32_LEAN_AND_MEAN
|
DEFINES += -DWIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
# UPNP Support
|
# UPNP Support
|
||||||
|
@ -16,7 +16,12 @@ ifeq ($(USE_UPNP),yes)
|
||||||
LDLIBS = -lminiupnpc
|
LDLIBS = -lminiupnpc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_WINXP_FLAGS), yes)
|
||||||
|
DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
||||||
|
endif
|
||||||
|
|
||||||
LDLIBS += \
|
LDLIBS += \
|
||||||
|
$(MINGW_PREFIX)/lib/libboost_filesystem-mt.a \
|
||||||
$(MINGW_PREFIX)/lib/libboost_program_options-mt.a \
|
$(MINGW_PREFIX)/lib/libboost_program_options-mt.a \
|
||||||
$(MINGW_PREFIX)/lib/libssl.a \
|
$(MINGW_PREFIX)/lib/libssl.a \
|
||||||
$(MINGW_PREFIX)/lib/libcrypto.a \
|
$(MINGW_PREFIX)/lib/libcrypto.a \
|
||||||
|
@ -37,10 +42,6 @@ ifeq ($(USE_WIN32_APP), yes)
|
||||||
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_WINXP_FLAGS), yes)
|
|
||||||
DEFINES += -DWINVER=0x0501 -D_WIN32_WINNT=0x0501
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(USE_AESNI),yes)
|
ifeq ($(USE_AESNI),yes)
|
||||||
NEEDED_CXXFLAGS += -maes
|
NEEDED_CXXFLAGS += -maes
|
||||||
LDFLAGS += -maes
|
LDFLAGS += -maes
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2020, The PurpleI2P Project
|
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2020, The PurpleI2P Project
|
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
|
|
@ -261,13 +261,13 @@ namespace fs {
|
||||||
#else */ // TODO: wait until implemented
|
#else */ // TODO: wait until implemented
|
||||||
const auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
|
const auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
|
||||||
t - decltype(t)::clock::now() + std::chrono::system_clock::now());
|
t - decltype(t)::clock::now() + std::chrono::system_clock::now());
|
||||||
/*#endif */
|
/*#endif */
|
||||||
return std::chrono::system_clock::to_time_t(sctp);
|
return std::chrono::system_clock::to_time_t(sctp);
|
||||||
#else
|
#else
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
auto t = boost::filesystem::last_write_time (path, ec);
|
auto t = boost::filesystem::last_write_time (path, ec);
|
||||||
return ec ? 0 : t;
|
return ec ? 0 : t;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Remove(const std::string & path) {
|
bool Remove(const std::string & path) {
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#ifndef STD_FILESYSTEM
|
#ifndef STD_FILESYSTEM
|
||||||
# if (!TARGET_OS_SIMULATOR && __has_include(<filesystem>)) // supports std::filesystem
|
# if (_WIN32 && __GNUG__) // MinGW GCC somehow incorrectly converts paths
|
||||||
|
# define STD_FILESYSTEM 0
|
||||||
|
# elif (!TARGET_OS_SIMULATOR && __has_include(<filesystem>)) // supports std::filesystem
|
||||||
# define STD_FILESYSTEM 1
|
# define STD_FILESYSTEM 1
|
||||||
# else
|
# else
|
||||||
# define STD_FILESYSTEM 0
|
# define STD_FILESYSTEM 0
|
||||||
|
|
Loading…
Reference in a new issue