fdbservice and fdbrpc now compiling

This commit is contained in:
mpilman 2019-02-06 19:27:38 -08:00 committed by Alex Miller
parent 7a858b902d
commit 8a94d80deb
13 changed files with 61 additions and 36 deletions

View File

@ -205,7 +205,11 @@ add_subdirectory(fdbrpc)
add_subdirectory(fdbclient)
add_subdirectory(fdbserver)
add_subdirectory(fdbcli)
add_subdirectory(fdbmonitor)
if(NOT WIN32)
add_subdirectory(fdbmonitor)
else()
add_subdirectory(fdbservice)
endif()
add_subdirectory(bindings)
add_subdirectory(fdbbackup)
add_subdirectory(tests)

View File

@ -17,12 +17,24 @@ set(out_files "")
foreach(src ${SRCS})
get_filename_component(dirname ${src} DIRECTORY)
get_filename_component(extname ${src} EXT)
if(NOT EXISTS ${dirname})
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bindings/python/${dirname})
endif()
set(copy_command "cp")
set(from_path ${CMAKE_CURRENT_SOURCE_DIR}/${src})
set(to_path ${CMAKE_CURRENT_BINARY_DIR}/${src})
if (WIN32)
set(copy_command "copy")
# copy on Windows doesn't understand '/' separators
string(REPLACE "/" "\\" from_path "${from_path}")
string(REPLACE "/" "\\" to_path "${to_path}")
endif()
message(STATUS "COPY Command: ${copy_command} ${from_path} ${to_path}")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/bindings/python/${src}
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/bindings/python/${dirname}
COMMAND cp ${src} ${PROJECT_BINARY_DIR}/bindings/python/${dirname}/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "copy ${src}")
COMMAND ${copy_command} ${from_path} ${to_path}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "copy ${src}")
set(out_files "${out_files};${PROJECT_BINARY_DIR}/bindings/python/${src}")
endforeach()
add_custom_target(python_binding ALL DEPENDS ${out_files})

View File

@ -31,7 +31,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (NOT OPEN_FOR_IDE)
add_definitions(-DNO_INTELLISENSE)
endif()
add_definitions(-DUSE_UCONTEXT)
if(WIN32)
add_definitions(-DUSE_USEFIBERS)
else()
add_definitions(-DUSE_UCONTEXT)
endif()
enable_language(ASM)
include(CheckFunctionExists)
@ -40,7 +44,7 @@ set(CMAKE_REQUIRED_LIBRARIES c)
if(WIN32)
add_compile_options(/W3 /EHsc /std:c++11)
add_compile_options(/W3 /EHsc /std:c++14 /bigobj)
else()
if(USE_GOLD_LINKER)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")

View File

@ -2,9 +2,12 @@ set(FDBCLI_SRCS
fdbcli.actor.cpp
FlowLineNoise.actor.cpp
FlowLineNoise.h
linenoise/linenoise.c
linenoise/linenoise.h)
if(NOT WIN32)
list(APPEN FDBCLI_SRCS linenoise/linenoise.c)
endif()
actor_set(FDBCLI_BUILD "${FDBCLI_SRCS}")
add_executable(fdbcli "${FDBCLI_BUILD}")
actor_compile(fdbcli "${FDBCLI_SRCS}")

View File

@ -47,9 +47,7 @@
#include "fdbcli/linenoise/linenoise.h"
#endif
#ifndef WIN32
#include "versions.h"
#endif
#include "fdbclient/versions.h"
#include "flow/actorcompiler.h" // This must be the last #include.

View File

@ -35,6 +35,7 @@
#include "fdbclient/MutationList.h"
#include "fdbclient/CoordinationInterface.h"
#include "fdbclient/MonitorLeader.h"
#include "fdbclient/versions.h"
#include "fdbrpc/TLSConnection.h"
#include "flow/Knobs.h"
#include "fdbclient/Knobs.h"
@ -50,16 +51,15 @@
#undef max
#else
#include <time.h>
#include "versions.h"
#endif
#include "flow/actorcompiler.h" // This must be the last #include.
#include "flow/actorcompiler.h" // This must be the last #include.
extern IRandom* trace_random;
extern const char* getHGVersion();
using std::min;
using std::max;
using std::make_pair;
using std::max;
using std::min;
NetworkOptions networkOptions;
Reference<TLSOptions> tlsOptions;

View File

@ -21,12 +21,9 @@
#include "fdbclient/ThreadSafeTransaction.h"
#include "fdbclient/ReadYourWrites.h"
#include "fdbclient/DatabaseContext.h"
#include "fdbclient/versions.h"
#include <new>
#ifndef WIN32
#include "versions.h"
#endif
// Users of ThreadSafeTransaction might share Reference<ThreadSafe...> between different threads as long as they don't call addRef (e.g. C API follows this).
// Therefore, it is unsafe to call (explicitly or implicitly) this->addRef in any of these functions.

View File

@ -33,9 +33,7 @@ set(FDBRPC_SRCS
TraceFileIO.cpp
# C files
libcoroutine/Common.c
libcoroutine/context.c
libcoroutine/Coro.c
libeio/eio.c
zlib/adler32.c
zlib/crc32.c
zlib/deflate.c
@ -51,7 +49,10 @@ set(FDBRPC_SRCS
zlib/zutil.c)
if(APPLE)
list(APPEND FDBRPC_SRCS libcoroutine/asm.S libcoroutine/context.c)
list(APPEND FDBRPC_SRCS libcoroutine/asm.S)
endif()
if(NOT WIN32)
list(APPEND FDBRPC_SRCS libcoroutine/context.c libeio/eio.c)
endif()
actor_set(FDBRPC_BUILD "${FDBRPC_SRCS}")

View File

@ -34,10 +34,7 @@
#include "fdbclient/ManagementAPI.h"
#include "fdbclient/NativeAPI.h"
#include "fdbclient/BackupAgent.h"
#ifndef WIN32
#include "versions.h"
#endif
#include "fdbclient/versions.h"
#include "flow/actorcompiler.h" // This must be the last #include.
#undef max

View File

@ -40,12 +40,6 @@
#include <stdio.h>
#include <fstream>
#include "fdbserver/pubsub.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#undef min
#undef max
#endif
#include "fdbserver/SimulatedCluster.h"
#include "fdbserver/TesterInterface.h"
#include "fdbserver/workloads/workloads.h"
@ -56,6 +50,7 @@
#include "fdbrpc/Platform.h"
#include "fdbserver/CoroFlow.h"
#include "flow/SignalSafeUnwind.h"
#include "fdbclient/versions.h"
#define BOOST_DATE_TIME_NO_LIB
#include <boost/interprocess/managed_shared_memory.hpp>
@ -68,8 +63,10 @@
#endif
#endif
#ifndef WIN32
#include "versions.h"
#ifdef WIN32
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif
#include "flow/SimpleOpt.h"

View File

@ -0,0 +1,9 @@
set(FDBSERVICE_SRCS FDBService.cpp ServiceBase.cpp)
add_executable(fdbservice ${FDBSERVICE_SRCS})
#
# FIXME: This include directory is an ugly hack. We probably want to fix this
# as soon as we get rid of the old build system
target_include_directories(fdbservice PRIVATE ${CMAKE_BINARY_DIR}/fdbclient)
install(TARGETS fdbservice DESTINATION "${FDB_LIB_NOSUFFIX}/foundationdb" COMPONENT server)

View File

@ -30,6 +30,7 @@
#include "..\flow\SimpleOpt.h"
#include "..\fdbmonitor\SimpleIni.h"
#include "fdbclient/versions.h"
// For PathFileExists
#include "Shlwapi.h"

View File

@ -82,8 +82,10 @@ add_library(flow STATIC ${FLOW_BUILD})
actor_compile(flow "${FLOW_SRCS}")
target_include_directories(flow SYSTEM PUBLIC ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(flow PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
if (NOT APPLE)
if (NOT APPLE AND NOT WIN32)
set (FLOW_LIBS ${FLOW_LIBS} rt)
elseif(WIN32)
target_link_libraries(flow PUBLIC winmm.lib)
endif()
target_link_libraries(flow PRIVATE ${FLOW_LIBS})
target_link_libraries(flow PUBLIC boost_target Threads::Threads ${CMAKE_DL_LIBS})