Skip to content

Fix building on windows with clang and msvc #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions include/io/stream_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "tag.h"
#include "endian_str.h"
#include <iosfwd>
#include <string>

namespace nbt
{
Expand Down
5 changes: 0 additions & 5 deletions include/tag_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ typedef tag_array<int8_t> tag_byte_array;
typedef tag_array<int32_t> tag_int_array;
typedef tag_array<int64_t> tag_long_array;

//Explicit instantiations
template class NBT_EXPORT tag_array<int8_t>;
template class NBT_EXPORT tag_array<int32_t>;
template class NBT_EXPORT tag_array<int64_t>;

}

#endif // TAG_ARRAY_H_INCLUDED
2 changes: 1 addition & 1 deletion include/tag_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void tag_list::init(std::initializer_list<Arg> init)
el_type_ = T::type;
tags.reserve(init.size());
for(const Arg& arg: init)
tags.emplace_back(make_unique<T>(arg));
tags.emplace_back(nbt::make_unique<T>(arg));
}

}
Expand Down
5 changes: 5 additions & 0 deletions src/tag_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@ void tag_array<int64_t>::write_payload(io::stream_writer& writer) const
writer.write_num(i);
}

//Explicit instantiations
template class NBT_EXPORT tag_array<int8_t>;
template class NBT_EXPORT tag_array<int32_t>;
template class NBT_EXPORT tag_array<int64_t>;

}