Skip to content
Snippets Groups Projects
Commit 48254a67 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

build/cmake: add opendht_EXPORTS as public definition

parent 37ccc2f3
No related branches found
No related tags found
No related merge requests found
......@@ -433,6 +433,7 @@ if (BUILD_SHARED_LIBS)
set_target_properties (opendht PROPERTIES IMPORT_SUFFIX "_import.lib")
set_target_properties (opendht PROPERTIES SOVERSION ${opendht_VERSION_MAJOR} VERSION ${opendht_VERSION})
target_compile_definitions(opendht PRIVATE OPENDHT_BUILD)
target_compile_definitions(opendht PUBLIC opendht_EXPORTS)
endif ()
install (TARGETS opendht DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT opendht)
......
......@@ -6,11 +6,6 @@ endif()
function (configure_tool name extra_files)
add_executable (${name} ${name}.cpp ${extra_files})
add_dependencies(${name} opendht)
if (NOT BUILD_SHARED_LIBS)
target_compile_definitions(${name} PRIVATE OPENDHT_STATIC) # to define proper attributes for the opendht classes
else()
target_compile_definitions(${name} PRIVATE opendht_EXPORTS)
endif()
if (MSVC)
target_sources(${name} PRIVATE ${MSC_COMPAT_SOURCES})
target_link_libraries (${name} PUBLIC opendht wsock32 ws2_32)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment