Skip to content

Commit 90f0acf

Browse files
authored
Merge pull request #52 from dzenanz/master
Fixes for compiling on VS2019
2 parents fb3c621 + b6de3dc commit 90f0acf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ macro(xtensor_zarr_create_target source target_name linkage output_name)
248248
${target_name}
249249
PUBLIC nlohmann_json::nlohmann_json
250250
PUBLIC xtl
251+
PUBLIC xtensor-zarr
251252
)
252253

253254
set_target_properties(
@@ -261,6 +262,11 @@ macro(xtensor_zarr_create_target source target_name linkage output_name)
261262
OUTPUT_NAME "lib${output_name}"
262263
)
263264

265+
if (MSVC) # the object files can get big, so we need to "Increase Number of Sections in .Obj file"
266+
# target_compile_definitions(${target_name} PUBLIC COMPILE_DEFINITIONS -Dbigobj) # doesn't work
267+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
268+
endif()
269+
264270
# Compilation flags
265271
# =================
266272

include/xtensor-zarr/xzarr_file_system_store.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace xt
124124
{
125125
if (!fs::is_directory(directory))
126126
{
127-
XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory));
127+
XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory.string()));
128128
}
129129
}
130130
else
@@ -209,7 +209,7 @@ namespace xt
209209
std::string path = m_root + '/' + prefix;
210210
for (const auto& entry: fs::directory_iterator(path))
211211
{
212-
std::string p = entry.path();
212+
std::string p = entry.path().string();
213213
if (fs::is_directory(p))
214214
{
215215
prefixes.push_back(p.substr(m_root.size() + 1));
@@ -244,7 +244,7 @@ namespace xt
244244
std::vector<std::string> keys;
245245
for (const auto& entry: fs::recursive_directory_iterator(path))
246246
{
247-
std::string p = entry.path();
247+
std::string p = entry.path().string();
248248
keys.push_back(p.substr(m_root.size() + 1));
249249
}
250250
return keys;

0 commit comments

Comments
 (0)