Closed kleuter closed 3 months ago
Hi!
This is weird! The BIT7Z_DISABLE_USE_STD_FILESYSTEM
is not used to define a preprocessor flag, it is used to decide which C++ standard version to use to build the library.
If you enable BIT7Z_DISABLE_USE_STD_FILESYSTEM
in CMake, the project should be configured to use C++14, and thus the compiler should not give access to the std::filesystem
library.
So the #if defined( __cpp_lib_filesystem )
and #if BIT7Z_CPP_STANDARD >= 17 && defined( __has_include )
conditions should be both false, and BIT7Z_USE_STANDARD_FILESYSTEM
would never be defined.
I guess I can get CMake to define the BIT7Z_DISABLE_USE_STD_FILESYSTEM
preprocessor flag and use the #ifndef BIT7Z_DISABLE_USE_STD_FILESYSTEM
as you did.
Update: I've pushed the fix to the hotfix/v4.0.6
branch.
Now using the BIT7Z_DISABLE_USE_STD_FILESYSTEM
CMake option will define the namesake preprocessor flag, and will prevent bidefines.hpp
from defining the BIT7Z_USE_STANDARD_FILESYSTEM
.
The next patch version v4.0.6 will contain the fix.
Thank you, it's important when not using cmake
bit7z version
4.0.x
Compilation options
BIT7Z_AUTO_FORMAT
7-zip version
v23.01
7-zip shared library used
7z.dll / 7z.so
Compilers
Clang
Compiler versions
No response
Architecture
x86_64
Operating system
macOS
Operating system versions
No response
Bug description
I wanted to compile the lib to used on older macOS, but compilation failed with Error 'path' is unavailable: introduced in macOS 10.15, so basically the lib tried to use std::filesystem, adding BIT7Z_DISABLE_USE_STD_FILESYSTEM didn't give any effect (looks like this define is not used in the lib).
When I changed this (in bitdefines.hpp)
to this
It works fine. Would it be correct to include this to the lib?
Steps to reproduce
No response
Expected behavior
No response
Relevant compilation output
No response
Code of Conduct