Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
MelamudMichael authored Feb 7, 2024
1 parent 058d1c3 commit ebebdf9
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,34 @@ set(UPROTOCOL_SRC
add_definitions(-DFMT_HEADER_ONLY)
add_definitions(-DSPDLOG_FMT_EXTERNAL)

add_library(up-cpp SHARED
${UPROTOCOL_SRC})
#add_library(up-cpp SHARED
# ${UPROTOCOL_SRC})

add_library(uprotocollib OBJECT ${UPROTOCOL_SRC})

set_property(TARGET uprotocollib PROPERTY POSITION_INDEPENDENT_CODE 1)

add_library(up-cpp SHARED $<TARGET_OBJECTS:uprotocollib>)
add_library(up-cpp_static STATIC $<TARGET_OBJECTS:uprotocollib>)

set_target_properties(up-cpp_static PROPERTIES OUTPUT_NAME up-cpp)

add_definitions(-DSPDLOG_FMT_EXTERNAL)


if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
target_link_libraries(up-cpp PRIVATE
${CONAN_LIBS})

target_link_libraries(up-cpp_static
${CONAN_LIBS})

target_link_libraries(up-cpp
${CONAN_LIBS})
else()

target_link_libraries(up-cpp_static
protobuf::protobuf
spdlog::spdlog)

target_link_libraries(up-cpp PRIVATE
protobuf::protobuf
spdlog::spdlog)
Expand Down

0 comments on commit ebebdf9

Please sign in to comment.