Unverified Commit 01f293da authored by kennytm's avatar kennytm Committed by GitHub

Fix build on Windows (#138)

1. use `#include "port/port.h"` instead of `#include "port/port_posix.h"`
2. added an "install" target for CMake to workaround alexcrichton/cmake-rs#18
3. MSVC reported 2 warnings in Titan (and tons of warnings in RocksDB), and these are fixed.
parent 4e2c6e0c
...@@ -105,12 +105,12 @@ if (WITH_TITAN_TESTS AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release")) ...@@ -105,12 +105,12 @@ if (WITH_TITAN_TESTS AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release"))
rocksdb rocksdb
testutillib testutillib
gtest) gtest)
foreach(test ${TESTS}) foreach(test ${TESTS})
add_executable(titan_${test} src/${test}.cc $<TARGET_OBJECTS:testharness>) add_executable(titan_${test} src/${test}.cc $<TARGET_OBJECTS:testharness>)
target_link_libraries(titan_${test} ${TEST_LIBS}) target_link_libraries(titan_${test} ${TEST_LIBS})
add_test(titan_${test} titan_${test}) add_test(titan_${test} titan_${test})
endforeach(test ${TESTS}) endforeach(test ${TESTS})
endif() endif()
if (WITH_TITAN_TOOLS) if (WITH_TITAN_TOOLS)
...@@ -138,3 +138,16 @@ if (WITH_TITAN_TOOLS) ...@@ -138,3 +138,16 @@ if (WITH_TITAN_TOOLS)
target_include_directories(titandb_bench PRIVATE ${gflags_INCLUDE_DIR}) target_include_directories(titandb_bench PRIVATE ${gflags_INCLUDE_DIR})
target_link_libraries(titandb_bench ${TOOLS_LIBS}) target_link_libraries(titandb_bench ${TOOLS_LIBS})
endif() endif()
# Installation - copy lib/ and include/
include(GNUInstallDirs)
install(DIRECTORY include/titan
COMPONENT devel
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
install(TARGETS titan
COMPONENT devel
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "blob_storage.h" #include "blob_storage.h"
#include "db/log_reader.h" #include "db/log_reader.h"
#include "db/log_writer.h" #include "db/log_writer.h"
#include "port/port_posix.h" #include "port/port.h"
#include "rocksdb/options.h" #include "rocksdb/options.h"
#include "rocksdb/status.h" #include "rocksdb/status.h"
#include "titan/options.h" #include "titan/options.h"
......
...@@ -150,8 +150,6 @@ void BlobStorage::GetObsoleteFiles(std::vector<std::string>* obsolete_files, ...@@ -150,8 +150,6 @@ void BlobStorage::GetObsoleteFiles(std::vector<std::string>* obsolete_files,
SequenceNumber oldest_sequence) { SequenceNumber oldest_sequence) {
MutexLock l(&mutex_); MutexLock l(&mutex_);
uint32_t file_dropped = 0;
uint64_t file_dropped_size = 0;
for (auto it = obsolete_files_.begin(); it != obsolete_files_.end();) { for (auto it = obsolete_files_.begin(); it != obsolete_files_.end();) {
auto& file_number = it->first; auto& file_number = it->first;
auto& obsolete_sequence = it->second; auto& obsolete_sequence = it->second;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment