Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
# Configure compilers

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_DEBUG_POSTFIX d) # this allows packaging debug and release together, without filename clashes
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything \
-Wno-c++98-compat \
Expand Down Expand Up @@ -169,6 +171,13 @@ if (BUILD_SHARED_LIBS)
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)

if (MSVC)
install(FILES $<TARGET_PDB_FILE:opentracing>
DESTINATION ${LIB_INSTALL_DIR}
CONFIGURATIONS Debug RelWithDebInfo)
endif()

if (CLANG_TIDY_EXE)
set_target_properties(opentracing PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}")
Expand All @@ -178,6 +187,8 @@ endif()
if (BUILD_STATIC_LIBS)
add_library(opentracing-static STATIC ${SRCS})
target_link_libraries(opentracing-static ${LIBRARIES})
set_target_properties(opentracing-static PROPERTIES COMPILE_PDB_NAME opentracing-static)
set_target_properties(opentracing-static PROPERTIES COMPILE_PDB_NAME_DEBUG opentracing-static${CMAKE_DEBUG_POSTFIX})
# Windows generates a lib and dll files for a shared library. using the same name will override the lib file generated by the shared target
if (NOT WIN32)
set_target_properties(opentracing-static PROPERTIES OUTPUT_NAME opentracing)
Expand All @@ -186,6 +197,11 @@ if (BUILD_STATIC_LIBS)
target_include_directories(opentracing-static INTERFACE "$<INSTALL_INTERFACE:include/>")
install(TARGETS opentracing-static EXPORT OpenTracingTargets
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
if (MSVC)
install(FILES $<TARGET_FILE_DIR:opentracing-static>/$<TARGET_FILE_BASE_NAME:opentracing-static>.pdb
DESTINATION ${LIB_INSTALL_DIR}
CONFIGURATIONS Debug RelWithDebInfo)
endif()
endif()


Expand Down