Skip to content

Commit

Permalink
Fix for JSON initialization issue in Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul committed Feb 1, 2024
1 parent a251860 commit 07a01ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ pybind11_add_module(libargolid
target_compile_definitions(libargolid PRIVATE VERSION_INFO=${VERSION_INFO})

#target_compile_definitions(libargolid PRIVATE WITH_PYTHON_H)
set(NLJSON_HACK ON) # more details here: https://github.com/nlohmann/json/issues/2311
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
target_link_libraries(libargolid PRIVATE stdc++fs)
set(NLJSON_HACK OFF)
endif()

target_link_libraries(libargolid PRIVATE tensorstore::tensorstore tensorstore::all_drivers filepattern::filepattern)
Expand Down
3 changes: 1 addition & 2 deletions src/ome_tiff_to_chunked_pyramid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ void OmeTiffToChunkedPyramid::WriteTSZattrFile(const std::string& tiff_file_name
combined_metadata["name"] = tiff_file_name;
combined_metadata["metadata"] = {{"method", "mean"}};
json final_formated_metadata;
#if defined(__clang__) || defined(_MSC_VER)
// more details here: https://github.com/nlohmann/json/issues/2311
#if defined(NLJSON_HACK)
final_formated_metadata["multiscales"][0] = {combined_metadata};
#else
final_formated_metadata["multiscales"] = {combined_metadata};
Expand Down

0 comments on commit 07a01ab

Please sign in to comment.