mdbx-build: start using CMake (incomplete; no properly installation for now).

This commit is contained in:
Leonid Yuriev
2019-08-31 17:13:02 +03:00
parent f81374a9ce
commit 5a87faf9af
25 changed files with 1541 additions and 104 deletions

View File

@@ -1,5 +1,3 @@
project(mdbx_tools)
set(MDBX_TOOLS
mdbx_chk
mdbx_copy
@@ -9,11 +7,23 @@ set(MDBX_TOOLS
)
foreach (TOOL ${MDBX_TOOLS})
add_executable(${TOOL} ${TOOL}.c)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
add_executable(${TOOL} ${TOOL}.c wingetopt.c wingetopt.h)
else()
add_executable(${TOOL} ${TOOL}.c)
endif()
target_link_libraries(${TOOL} mdbx_objects ${CMAKE_THREAD_LIBS_INIT})
set_target_properties(${TOOL} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION $<BOOL:${INTERPROCEDURAL_OPTIMIZATION}>)
target_link_libraries(${TOOL} mdbx)
install(TARGETS ${TOOL} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin COMPONENT mdbx)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.1)
install(FILES ${TOOL}.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1 COMPONENT mdbx)
endif()
endforeach()
if(LIB_MATH)
target_link_libraries(mdbx_chk ${LIB_MATH})
target_link_libraries(mdbx_stat ${LIB_MATH})
endif()

View File

@@ -20,8 +20,7 @@
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER (warnings) */
/* Avoid reference to mdbx_runtime_flags from assert() */
#define mdbx_runtime_flags (~0u)
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
#include "../elements/internals.h"
typedef struct flagbit {

View File

@@ -20,8 +20,7 @@
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER (warnings) */
/* Avoid reference to mdbx_runtime_flags from assert() */
#define mdbx_runtime_flags (~0u)
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
#include "../elements/internals.h"
#if defined(_WIN32) || defined(_WIN64)

View File

@@ -20,8 +20,7 @@
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER (warnings) */
/* Avoid reference to mdbx_runtime_flags from assert() */
#define mdbx_runtime_flags (~0u)
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
#include "../elements/internals.h"
#include <ctype.h>

View File

@@ -20,8 +20,7 @@
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER (warnings) */
/* Avoid reference to mdbx_runtime_flags from assert() */
#define mdbx_runtime_flags (~0u)
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
#include "../elements/internals.h"
#include <ctype.h>

View File

@@ -20,8 +20,7 @@
#pragma warning(disable : 4996) /* The POSIX name is deprecated... */
#endif /* _MSC_VER (warnings) */
/* Avoid reference to mdbx_runtime_flags from assert() */
#define mdbx_runtime_flags (~0u)
#define MDBX_TOOLS /* Avoid using internal mdbx_assert() */
#include "../elements/internals.h"
#if defined(_WIN32) || defined(_WIN64)