File tree Expand file tree Collapse file tree 7 files changed +29
-15
lines changed
Expand file tree Collapse file tree 7 files changed +29
-15
lines changed Original file line number Diff line number Diff line change 3030/build
3131/examples /build
3232.vscode /settings.json
33+
34+ /out /**
Original file line number Diff line number Diff line change 11[submodule "vendor/miniz-cpp "]
22 path = vendor/miniz-cpp
3- url = https://github.com/tfussell /miniz-cpp.git
3+ url = https://github.com/nextgeniuspro /miniz-cpp.git
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
22
33# Project name and version
44project (vfspp VERSION 1.0 LANGUAGES CXX)
5-
5+ option (BUILD_EXAMPLES "Build examples" OFF )
66# Add the miniz-cpp library
77add_subdirectory (vendor/miniz-cpp EXCLUDE_FROM_ALL )
88
@@ -13,6 +13,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1313
1414# Add the include directory as a target
1515add_library (vfspp INTERFACE )
16+ add_library (vfspp::vfspp ALIAS vfspp)
1617
1718target_include_directories (vfspp
1819 INTERFACE
@@ -21,4 +22,8 @@ target_include_directories(vfspp
2122 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /vendor/miniz-cpp>
2223)
2324
24- target_compile_features (vfspp INTERFACE cxx_std_17)
25+ target_compile_features (vfspp INTERFACE cxx_std_17)
26+
27+ if (BUILD_EXAMPLES)
28+ add_subdirectory (examples)
29+ endif ()
Original file line number Diff line number Diff line change @@ -142,11 +142,13 @@ See examples/CMakeLists.txt for example of usage
142142
143143## How To Build Example #
144144
145- - Navigate to 'examples' directory
145+ - Run cmake to generate project windows project files
146146``` bash
147- cd examples
148- ```
149- - Run cmake to generate project
147+ cmake -B ./build -G " Visual Studio 17 2022 " . -DBUILD_EXAMPLES=1
148+ ```
149+ or to generate Xcode project files
150150``` bash
151- cmake -B ./build -G " Visual Studio 17 2022 " .
151+ cmake -B ./build -G " Xcode " . -DBUILD_EXAMPLES=1
152152```
153+
154+ - Open generated project files and build the target ` vfsppexample `
Original file line number Diff line number Diff line change @@ -2,21 +2,20 @@ cmake_minimum_required(VERSION 3.10)
22
33project (vfsppexample)
44
5- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /.. vfspp_build)
5+ # add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. vfspp_build)
66
77add_executable (vfsppexample example.cpp)
88
99add_compile_definitions (VFSPP_ENABLE_MULTITHREADING)
1010
11- target_link_libraries (vfsppexample PRIVATE vfspp)
11+ target_link_libraries (vfsppexample PRIVATE vfspp::vfspp )
1212target_compile_features (vfsppexample PRIVATE cxx_std_17)
1313
1414# Specify the output directory
15+ set (COPY_SOURCE ${CMAKE_SOURCE_DIR} /examples/test -data)
1516set (COPY_DESTINATION ${CMAKE_CURRENT_BINARY_DIR} /test -data)
1617
1718# Add a post-build step to copy the whole directory
1819add_custom_command (TARGET vfsppexample POST_BUILD
19- COMMAND ${CMAKE_COMMAND} -E copy_directory
20- ${CMAKE_SOURCE_DIR} /test -data
21- ${COPY_DESTINATION}
20+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${COPY_SOURCE} ${COPY_DESTINATION}
2221)
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ class NativeFile final : public IFile
246246 m_Mode = mode;
247247 m_IsReadOnly = true ;
248248
249- std::ios_base::openmode open_mode = ( std::ios_base::openmode) 0x00 ;
249+ std::ios_base::openmode open_mode = std::ios_base::binary ;
250250 if ((mode & FileMode::Read) == FileMode::Read) {
251251 open_mode |= std::fstream::in;
252252 }
Original file line number Diff line number Diff line change @@ -144,7 +144,13 @@ class ZipFileSystem final : public IFileSystem
144144 {
145145 return false ;
146146 }
147-
147+ /*
148+ * Close file
149+ */
150+ virtual void CloseFile (IFilePtr file) override
151+ {
152+ // NO-OP
153+ }
148154 /*
149155 * Check if file exists on filesystem
150156 */
You can’t perform that action at this time.
0 commit comments