Skip to content

Commit

Permalink
export platform
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev committed Sep 28, 2024
1 parent 1e5d485 commit e615e0f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
22 changes: 8 additions & 14 deletions src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,19 @@ elseif (CX_PLATFORM STREQUAL "darwin")
endif()

include(GNUInstallDirs)
set(include_dest ${CMAKE_INSTALL_INCLUDEDIR})

if(BUILD_SHARED_LIBS)
target_include_directories(msquic PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
$<INSTALL_INTERFACE:${include_dest}>)
else()
target_include_directories(msquic_static INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
$<INSTALL_INTERFACE:${include_dest}>)
target_include_directories(msquic INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
$<INSTALL_INTERFACE:${include_dest}>)
file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp")

if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3")
set(OTHER_TARGETS OpenSSL OpenSSLQuic)
endif()

file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp")
if(WIN32)
list(APPEND OTHER_TARGETS MsQuicEtw_Header)
endif()

if(BUILD_SHARED_LIBS)
install(TARGETS msquic EXPORT msquic DESTINATION lib)
install(TARGETS msquic platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib)
else()
install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib)
endif()
Expand Down
12 changes: 9 additions & 3 deletions src/generated/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ if(QUIC_ENABLE_LOGGING)
target_link_libraries(logging PRIVATE inc)

elseif(QUIC_LOGGING_TYPE STREQUAL "lttng")
target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common)
target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/linux)
target_include_directories(logging_inc INTERFACE ${LTTNGUST_INCLUDE_DIRS})
target_include_directories(logging_inc INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/common>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_include_directories(logging_inc INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/linux>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_include_directories(logging_inc INTERFACE
$<BUILD_INTERFACE:${LTTNGUST_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

FILE(GLOB LOGGING_FILES ${CMAKE_CURRENT_SOURCE_DIR}/linux/*.c)
add_library(logging STATIC ${LOGGING_FILES})
Expand Down
4 changes: 3 additions & 1 deletion src/inc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ target_compile_options(inc INTERFACE ${QUIC_C_FLAGS})
target_compile_options(inc INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${QUIC_CXX_FLAGS}>)

target_compile_definitions(inc INTERFACE ${QUIC_COMMON_DEFINES})
target_include_directories(inc INTERFACE ${QUIC_INCLUDE_DIR})
target_include_directories(inc INTERFACE
$<BUILD_INTERFACE:${QUIC_INCLUDE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_compile_features(inc INTERFACE cxx_std_17)
target_compile_features(inc INTERFACE c_std_11)
Expand Down
5 changes: 3 additions & 2 deletions submodules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ if (WIN32)
target_include_directories(
OpenSSLQuic
INTERFACE
$<$<CONFIG:Debug>:${OPENSSL_DIR}/debug/include>
$<$<NOT:$<CONFIG:Debug>>:${OPENSSL_DIR}/release/include>
$<BUILD_INTERFACE:$<$<CONFIG:Debug>:${OPENSSL_DIR}/debug/include>
$<$<NOT:$<CONFIG:Debug>>:${OPENSSL_DIR}/release/include>>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(
OpenSSLQuic
Expand Down

0 comments on commit e615e0f

Please sign in to comment.