Skip to content

Commit

Permalink
libs: removed libbareoscfg and libbareostatic
Browse files Browse the repository at this point in the history
- moved all symbols into libbareos
- inhibit DLL_IMP_EXP, CATS_IMP_EXP, SD_IMP_EXP
  • Loading branch information
franku committed Sep 11, 2018
1 parent c6c4741 commit 73b5d06
Show file tree
Hide file tree
Showing 19 changed files with 5,991 additions and 96 deletions.
4 changes: 2 additions & 2 deletions core/src/console/CMakeLists.txt
Expand Up @@ -27,10 +27,10 @@ add_executable(bconsole console.cc)

add_library(console_objects STATIC ${BCONSSRCS})

set(CONSOLE_LINK_LIBRARIES console_objects bareos bareoscfg ${Readline_LIBRARY})
set(CONSOLE_LINK_LIBRARIES console_objects bareos ${Readline_LIBRARY})

IF(HAVE_WIN32)
LIST(APPEND CONSOLE_LINK_LIBRARIES bareosstatic)
LIST(APPEND CONSOLE_LINK_LIBRARIES)
ENDIF()

target_link_libraries(bconsole ${CONSOLE_LINK_LIBRARIES})
Expand Down
8 changes: 3 additions & 5 deletions core/src/dird/CMakeLists.txt
Expand Up @@ -67,7 +67,6 @@ set(BAREOS_DIR_LIBRARIES
dird_objects
bareos
bareoscats
bareoscfg
bareossql
bareosfind
${LMDB_LIBS}
Expand All @@ -76,7 +75,6 @@ set(BAREOS_DIR_LIBRARIES

IF(HAVE_WIN32)
LIST(APPEND BAREOS_DIR_LIBRARIES
bareosstatic
comctl32
)
ENDIF()
Expand All @@ -85,10 +83,10 @@ target_link_libraries(bareos-dir ${BAREOS_DIR_LIBRARIES})


add_executable(bareos-dbcheck ${DBCHKSRCS})
SET(DBCHECK_LIBRARIES bareossql bareos bareosfind bareoscfg bareoscats)
SET(DBCHECK_LIBRARIES bareossql bareos bareosfind bareoscats)

IF(HAVE_WIN32)
LIST(APPEND DBCHECK_LIBRARIES bareosstatic)
LIST(APPEND DBCHECK_LIBRARIES)
ENDIF()

target_link_libraries(bareos-dbcheck
Expand All @@ -99,7 +97,7 @@ target_link_libraries(bareos-dbcheck
# is not built by default

#add_executable(testfind ${TSTFNDSRCS})
#target_link_libraries(testfind bareos bareosfind bareoscfg
#target_link_libraries(testfind bareos bareosfind
# jansson ${OPENSSL_LIBS} acl cap lzo2
#)

Expand Down
4 changes: 2 additions & 2 deletions core/src/filed/CMakeLists.txt
Expand Up @@ -50,13 +50,13 @@ ENDIF()
add_executable(bareos-fd ${FDSRCS})

SET(BAREOS_FD_LIBRARIES
bareosfind bareoscfg bareos
bareosfind bareos
pthread
${LMDB_LIBS}
)
IF(HAVE_WIN32)
LIST(APPEND BAREOS_FD_LIBRARIES
comctl32 bareosstatic
comctl32
)

SET (FD_COMPILE_DEFINITIONS -DWIN32_VSS)
Expand Down
22 changes: 0 additions & 22 deletions core/src/include/baconfig.h
Expand Up @@ -105,31 +105,9 @@ void InitWinAPIWrapper();

#define ClearThreadId(x) memset(&(x), 0, sizeof(x))

#if defined(BUILDING_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllimport)
#elif defined(BUILDING_BAREOS_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllimport)
#elif defined(BUILDING_BAREOSCFG_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllexport)
#elif defined(USING_DLL)
#define DLL_IMP_EXP _declspec(dllimport)
#define CATS_IMP_EXP _declspec(dllimport)
#define SD_IMP_EXP _declspec(dllimport)
#else
#define BAREOSCFG_DLL_IMP_EXP
#define DLL_IMP_EXP
#define CATS_IMP_EXP
#define SD_IMP_EXP
#endif

#else /* HAVE_WIN32 */

Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/CMakeLists.txt
Expand Up @@ -33,7 +33,7 @@ set(INCLUDE_FILES ../include/baconfig.h ../include/bareos.h

INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${includedir})

add_subdirectory(bareoscfg)
#add_subdirectory(bareoscfg)
add_subdirectory(bareos)

IF(NOT HAVE_WIN32 AND GTEST_FOUND)
Expand Down
20 changes: 4 additions & 16 deletions core/src/lib/bareos/CMakeLists.txt
Expand Up @@ -52,12 +52,14 @@ IF(HAVE_WIN32)
../../win32/compat/print.cc
../../win32/compat/winapi.cc
)
set(BAREOSCFG_IMPORT_LIB bareoscfg_import_a)
ELSE()
LIST(APPEND BAREOS_SRCS
scsi_tapealert.cc)
ENDIF()

set (BAREOSCFG_SRCS ini.cc lex.cc parse_bsr.cc res.cc parse_conf.cc res.cc qualified_resource_name_type_converter.cc)
LIST(APPEND BAREOS_SRCS ${BAREOSCFG_SRCS})

#link_directories(${PROJECT_BINARY_DIR}/src/lib/bareos)
add_library(bareos SHARED ${BAREOS_SRCS})

Expand All @@ -73,20 +75,6 @@ set_target_properties(bareos PROPERTIES VERSION "${VERSION}"


IF(HAVE_WIN32)
IF ("${WINDOWS_BITS}" STREQUAL "64")
set(DLLTOOL x86_64-w64-mingw32-dlltool)
ELSE()
set(DLLTOOL i686-w64-mingw32-dlltool)
ENDIF()

ADD_CUSTOM_COMMAND(
PRE_LINK
TARGET bareos
DEPENDS libbareoscfg_${WINDOWS_BITS}.def
COMMAND ${DLLTOOL} -d ${CMAKE_CURRENT_SOURCE_DIR}/libbareoscfg_${WINDOWS_BITS}.def -l libbareoscfg_import_a
COMMAND echo ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cp libbareoscfg_import_a ${WINDOWS_IMPORT_LIB_DIRECTORY}/libbareoscfg_import_a.a)

set_target_properties(bareos PROPERTIES DEFINE_SYMBOL "BUILDING_BAREOS_DLL")
set_target_properties(bareos PROPERTIES DEFINE_SYMBOL "BUILDING_DLL")
ENDIF()

0 comments on commit 73b5d06

Please sign in to comment.