mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-21 14:02:59 +08:00
fdbservice and fdbrpc now compiling
This commit is contained in:
parent
7a858b902d
commit
8a94d80deb
@ -205,7 +205,11 @@ add_subdirectory(fdbrpc)
|
|||||||
add_subdirectory(fdbclient)
|
add_subdirectory(fdbclient)
|
||||||
add_subdirectory(fdbserver)
|
add_subdirectory(fdbserver)
|
||||||
add_subdirectory(fdbcli)
|
add_subdirectory(fdbcli)
|
||||||
add_subdirectory(fdbmonitor)
|
if(NOT WIN32)
|
||||||
|
add_subdirectory(fdbmonitor)
|
||||||
|
else()
|
||||||
|
add_subdirectory(fdbservice)
|
||||||
|
endif()
|
||||||
add_subdirectory(bindings)
|
add_subdirectory(bindings)
|
||||||
add_subdirectory(fdbbackup)
|
add_subdirectory(fdbbackup)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
@ -17,12 +17,24 @@ set(out_files "")
|
|||||||
foreach(src ${SRCS})
|
foreach(src ${SRCS})
|
||||||
get_filename_component(dirname ${src} DIRECTORY)
|
get_filename_component(dirname ${src} DIRECTORY)
|
||||||
get_filename_component(extname ${src} EXT)
|
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}
|
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/bindings/python/${src}
|
||||||
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/bindings/python/${dirname}
|
COMMAND ${copy_command} ${from_path} ${to_path}
|
||||||
COMMAND cp ${src} ${PROJECT_BINARY_DIR}/bindings/python/${dirname}/
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
COMMENT "copy ${src}")
|
||||||
COMMENT "copy ${src}")
|
|
||||||
set(out_files "${out_files};${PROJECT_BINARY_DIR}/bindings/python/${src}")
|
set(out_files "${out_files};${PROJECT_BINARY_DIR}/bindings/python/${src}")
|
||||||
endforeach()
|
endforeach()
|
||||||
add_custom_target(python_binding ALL DEPENDS ${out_files})
|
add_custom_target(python_binding ALL DEPENDS ${out_files})
|
||||||
|
@ -31,7 +31,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|||||||
if (NOT OPEN_FOR_IDE)
|
if (NOT OPEN_FOR_IDE)
|
||||||
add_definitions(-DNO_INTELLISENSE)
|
add_definitions(-DNO_INTELLISENSE)
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-DUSE_UCONTEXT)
|
if(WIN32)
|
||||||
|
add_definitions(-DUSE_USEFIBERS)
|
||||||
|
else()
|
||||||
|
add_definitions(-DUSE_UCONTEXT)
|
||||||
|
endif()
|
||||||
enable_language(ASM)
|
enable_language(ASM)
|
||||||
|
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
@ -40,7 +44,7 @@ set(CMAKE_REQUIRED_LIBRARIES c)
|
|||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_compile_options(/W3 /EHsc /std:c++11)
|
add_compile_options(/W3 /EHsc /std:c++14 /bigobj)
|
||||||
else()
|
else()
|
||||||
if(USE_GOLD_LINKER)
|
if(USE_GOLD_LINKER)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold -Wl,--disable-new-dtags")
|
||||||
|
@ -2,9 +2,12 @@ set(FDBCLI_SRCS
|
|||||||
fdbcli.actor.cpp
|
fdbcli.actor.cpp
|
||||||
FlowLineNoise.actor.cpp
|
FlowLineNoise.actor.cpp
|
||||||
FlowLineNoise.h
|
FlowLineNoise.h
|
||||||
linenoise/linenoise.c
|
|
||||||
linenoise/linenoise.h)
|
linenoise/linenoise.h)
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
list(APPEN FDBCLI_SRCS linenoise/linenoise.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
actor_set(FDBCLI_BUILD "${FDBCLI_SRCS}")
|
actor_set(FDBCLI_BUILD "${FDBCLI_SRCS}")
|
||||||
add_executable(fdbcli "${FDBCLI_BUILD}")
|
add_executable(fdbcli "${FDBCLI_BUILD}")
|
||||||
actor_compile(fdbcli "${FDBCLI_SRCS}")
|
actor_compile(fdbcli "${FDBCLI_SRCS}")
|
||||||
|
@ -47,9 +47,7 @@
|
|||||||
#include "fdbcli/linenoise/linenoise.h"
|
#include "fdbcli/linenoise/linenoise.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#include "fdbclient/versions.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.
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "fdbclient/MutationList.h"
|
#include "fdbclient/MutationList.h"
|
||||||
#include "fdbclient/CoordinationInterface.h"
|
#include "fdbclient/CoordinationInterface.h"
|
||||||
#include "fdbclient/MonitorLeader.h"
|
#include "fdbclient/MonitorLeader.h"
|
||||||
|
#include "fdbclient/versions.h"
|
||||||
#include "fdbrpc/TLSConnection.h"
|
#include "fdbrpc/TLSConnection.h"
|
||||||
#include "flow/Knobs.h"
|
#include "flow/Knobs.h"
|
||||||
#include "fdbclient/Knobs.h"
|
#include "fdbclient/Knobs.h"
|
||||||
@ -50,16 +51,15 @@
|
|||||||
#undef max
|
#undef max
|
||||||
#else
|
#else
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "versions.h"
|
|
||||||
#endif
|
#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 IRandom* trace_random;
|
||||||
extern const char* getHGVersion();
|
extern const char* getHGVersion();
|
||||||
|
|
||||||
using std::min;
|
|
||||||
using std::max;
|
|
||||||
using std::make_pair;
|
using std::make_pair;
|
||||||
|
using std::max;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
NetworkOptions networkOptions;
|
NetworkOptions networkOptions;
|
||||||
Reference<TLSOptions> tlsOptions;
|
Reference<TLSOptions> tlsOptions;
|
||||||
|
@ -21,12 +21,9 @@
|
|||||||
#include "fdbclient/ThreadSafeTransaction.h"
|
#include "fdbclient/ThreadSafeTransaction.h"
|
||||||
#include "fdbclient/ReadYourWrites.h"
|
#include "fdbclient/ReadYourWrites.h"
|
||||||
#include "fdbclient/DatabaseContext.h"
|
#include "fdbclient/DatabaseContext.h"
|
||||||
|
#include "fdbclient/versions.h"
|
||||||
#include <new>
|
#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).
|
// 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.
|
// Therefore, it is unsafe to call (explicitly or implicitly) this->addRef in any of these functions.
|
||||||
|
|
||||||
|
@ -33,9 +33,7 @@ set(FDBRPC_SRCS
|
|||||||
TraceFileIO.cpp
|
TraceFileIO.cpp
|
||||||
# C files
|
# C files
|
||||||
libcoroutine/Common.c
|
libcoroutine/Common.c
|
||||||
libcoroutine/context.c
|
|
||||||
libcoroutine/Coro.c
|
libcoroutine/Coro.c
|
||||||
libeio/eio.c
|
|
||||||
zlib/adler32.c
|
zlib/adler32.c
|
||||||
zlib/crc32.c
|
zlib/crc32.c
|
||||||
zlib/deflate.c
|
zlib/deflate.c
|
||||||
@ -51,7 +49,10 @@ set(FDBRPC_SRCS
|
|||||||
zlib/zutil.c)
|
zlib/zutil.c)
|
||||||
|
|
||||||
if(APPLE)
|
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()
|
endif()
|
||||||
|
|
||||||
actor_set(FDBRPC_BUILD "${FDBRPC_SRCS}")
|
actor_set(FDBRPC_BUILD "${FDBRPC_SRCS}")
|
||||||
|
@ -34,10 +34,7 @@
|
|||||||
#include "fdbclient/ManagementAPI.h"
|
#include "fdbclient/ManagementAPI.h"
|
||||||
#include "fdbclient/NativeAPI.h"
|
#include "fdbclient/NativeAPI.h"
|
||||||
#include "fdbclient/BackupAgent.h"
|
#include "fdbclient/BackupAgent.h"
|
||||||
|
#include "fdbclient/versions.h"
|
||||||
#ifndef WIN32
|
|
||||||
#include "versions.h"
|
|
||||||
#endif
|
|
||||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||||
|
|
||||||
#undef max
|
#undef max
|
||||||
|
@ -40,12 +40,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "fdbserver/pubsub.h"
|
#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/SimulatedCluster.h"
|
||||||
#include "fdbserver/TesterInterface.h"
|
#include "fdbserver/TesterInterface.h"
|
||||||
#include "fdbserver/workloads/workloads.h"
|
#include "fdbserver/workloads/workloads.h"
|
||||||
@ -56,6 +50,7 @@
|
|||||||
#include "fdbrpc/Platform.h"
|
#include "fdbrpc/Platform.h"
|
||||||
#include "fdbserver/CoroFlow.h"
|
#include "fdbserver/CoroFlow.h"
|
||||||
#include "flow/SignalSafeUnwind.h"
|
#include "flow/SignalSafeUnwind.h"
|
||||||
|
#include "fdbclient/versions.h"
|
||||||
|
|
||||||
#define BOOST_DATE_TIME_NO_LIB
|
#define BOOST_DATE_TIME_NO_LIB
|
||||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||||
@ -68,8 +63,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIN32
|
||||||
#include "versions.h"
|
#define NOMINMAX
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <Windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "flow/SimpleOpt.h"
|
#include "flow/SimpleOpt.h"
|
||||||
|
9
fdbservice/CMakeLists.txt
Normal file
9
fdbservice/CMakeLists.txt
Normal 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)
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "..\flow\SimpleOpt.h"
|
#include "..\flow\SimpleOpt.h"
|
||||||
#include "..\fdbmonitor\SimpleIni.h"
|
#include "..\fdbmonitor\SimpleIni.h"
|
||||||
|
#include "fdbclient/versions.h"
|
||||||
|
|
||||||
// For PathFileExists
|
// For PathFileExists
|
||||||
#include "Shlwapi.h"
|
#include "Shlwapi.h"
|
||||||
|
@ -82,8 +82,10 @@ add_library(flow STATIC ${FLOW_BUILD})
|
|||||||
actor_compile(flow "${FLOW_SRCS}")
|
actor_compile(flow "${FLOW_SRCS}")
|
||||||
target_include_directories(flow SYSTEM PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
target_include_directories(flow SYSTEM PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||||
target_include_directories(flow PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
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)
|
set (FLOW_LIBS ${FLOW_LIBS} rt)
|
||||||
|
elseif(WIN32)
|
||||||
|
target_link_libraries(flow PUBLIC winmm.lib)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(flow PRIVATE ${FLOW_LIBS})
|
target_link_libraries(flow PRIVATE ${FLOW_LIBS})
|
||||||
target_link_libraries(flow PUBLIC boost_target Threads::Threads ${CMAKE_DL_LIBS})
|
target_link_libraries(flow PUBLIC boost_target Threads::Threads ${CMAKE_DL_LIBS})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user