From 691cea4b1a4aa1779c9ae88d88924e2fd3dcb6fd Mon Sep 17 00:00:00 2001 From: gazelleguardian Date: Mon, 6 Dec 2021 03:54:47 +0100 Subject: Fix building on windows with clang and msvc Signed-off-by: Philipp David --- CMakeLists.txt | 2 +- include/io/stream_writer.h | 1 + include/tag_array.h | 5 ----- include/tag_list.h | 2 +- src/tag_array.cpp | 5 +++++ 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1faa5dc034..fafeae4b27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ if(DEFINED NBT_DEST_DIR) endif() if(NBT_USE_ZLIB) - target_link_libraries(${NBT_NAME} z) + target_link_libraries(${NBT_NAME} ZLIB::ZLIB) endif() set_property(TARGET ${NBT_NAME} PROPERTY CXX_STANDARD 11) generate_export_header(${NBT_NAME} BASE_NAME nbt) diff --git a/include/io/stream_writer.h b/include/io/stream_writer.h index b10f03adfa..a69508f392 100644 --- a/include/io/stream_writer.h +++ b/include/io/stream_writer.h @@ -23,6 +23,7 @@ #include "tag.h" #include "endian_str.h" #include +#include namespace nbt { diff --git a/include/tag_array.h b/include/tag_array.h index 6e6a92bbeb..bed84d8070 100644 --- a/include/tag_array.h +++ b/include/tag_array.h @@ -126,11 +126,6 @@ typedef tag_array tag_byte_array; typedef tag_array tag_int_array; typedef tag_array tag_long_array; -//Explicit instantiations -template class NBT_EXPORT tag_array; -template class NBT_EXPORT tag_array; -template class NBT_EXPORT tag_array; - } #endif // TAG_ARRAY_H_INCLUDED diff --git a/include/tag_list.h b/include/tag_list.h index ecd7e89c11..e2c9b7bb7c 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -215,7 +215,7 @@ void tag_list::init(std::initializer_list init) el_type_ = T::type; tags.reserve(init.size()); for(const Arg& arg: init) - tags.emplace_back(make_unique(arg)); + tags.emplace_back(nbt::make_unique(arg)); } } diff --git a/src/tag_array.cpp b/src/tag_array.cpp index 4a1668ad1e..a48f52a9c2 100644 --- a/src/tag_array.cpp +++ b/src/tag_array.cpp @@ -126,4 +126,9 @@ void tag_array::write_payload(io::stream_writer& writer) const writer.write_num(i); } +//Explicit instantiations +template class NBT_EXPORT tag_array; +template class NBT_EXPORT tag_array; +template class NBT_EXPORT tag_array; + } -- cgit 0.0.5-2-1-g0f52 From d84c3a5d9a463eb7256f0244ad69d3adac9de92e Mon Sep 17 00:00:00 2001 From: Philipp David Date: Sat, 19 Mar 2022 17:54:19 +0100 Subject: Bump cmake requirement for LTO --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fafeae4b27..d7e4c6a037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.9.4) project(libnbt++ VERSION 2.3) -- cgit 0.0.5-2-1-g0f52 From b156bcaa4acf0a5b392bbed60bd274c39e2398d4 Mon Sep 17 00:00:00 2001 From: Philipp David Date: Tue, 22 Mar 2022 17:02:06 +0100 Subject: Retab CMakeLists.txt --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e4c6a037..adbd3443d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,9 @@ option(NBT_USE_ZLIB "Build additional zlib stream functionality" ON) option(NBT_BUILD_TESTS "Build the unit tests. Requires CxxTest." ON) if(NBT_NAME) - message("Using override nbt++ name: ${NBT_NAME}") + message("Using override nbt++ name: ${NBT_NAME}") else() - set(NBT_NAME nbt++) + set(NBT_NAME nbt++) endif() # hide this from includers. @@ -48,12 +48,12 @@ target_include_directories(${NBT_NAME} PUBLIC include ${CMAKE_CURRENT_BINARY_DIR # Install it if(DEFINED NBT_DEST_DIR) - install( - TARGETS ${NBT_NAME} - ARCHIVE DESTINATION ${LIBRARY_DEST_DIR} - RUNTIME DESTINATION ${LIBRARY_DEST_DIR} - LIBRARY DESTINATION ${LIBRARY_DEST_DIR} - ) + install( + TARGETS ${NBT_NAME} + ARCHIVE DESTINATION ${LIBRARY_DEST_DIR} + RUNTIME DESTINATION ${LIBRARY_DEST_DIR} + LIBRARY DESTINATION ${LIBRARY_DEST_DIR} + ) endif() if(NBT_USE_ZLIB) -- cgit 0.0.5-2-1-g0f52