Skip to content

Commit

Permalink
Refactor cmake (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev authored Dec 16, 2024
1 parent ecdacc9 commit e346911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ set(QUIC_BUILD_SHARED ON CACHE BOOL "Builds MsQuic as a dynamic library")
set(QUIC_ENABLE_LOGGING ON CACHE BOOL "Enable MsQuic logging")
set(CMAKE_BUILD_TYPE "Release")
add_subdirectory(msquic)
target_compile_features(inc INTERFACE cxx_std_20)
target_compile_features(msh3_headers INTERFACE cxx_std_20)

# Build msh3 library (and cmd line tool).
add_subdirectory(lib)
Expand Down
9 changes: 6 additions & 3 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ else()
set(SOURCES msh3.cpp)
endif()
add_library(msh3 SHARED ${SOURCES})
target_link_libraries(msh3 PRIVATE inc warnings msquic ls-qpack msh3_headers)
target_link_libraries(msh3 PRIVATE msquic msquic_platform ls-qpack msh3_headers)
if (NOT BUILD_SHARED_LIBS)
target_link_libraries(msh3 PRIVATE base_link)
endif()
target_link_libraries(msh3 PRIVATE msquic_platform) # For selfsign APIs

if(WIN32)
SET_TARGET_PROPERTIES(msh3
Expand All @@ -24,7 +23,11 @@ elseif (CX_PLATFORM STREQUAL "darwin")
PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"")
endif()

install(TARGETS msh3 EXPORT msh3 DESTINATION lib)
install(TARGETS msh3 EXPORT msh3
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(FILES ../msh3.h DESTINATION include)
configure_file(msh3-config.cmake.in ${CMAKE_BINARY_DIR}/msh3-config.cmake)
install(FILES ${CMAKE_BINARY_DIR}/msh3-config.cmake DESTINATION share/msh3)
Expand Down

0 comments on commit e346911

Please sign in to comment.