-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save generated CLOG files in Repo, use them for linux build (#1845)
* Pregenerate clog files This removes the build time dependency on clog, which removes the build time dependency on .NET * Add a few missing logs, cleanup * Fixup linux build * Make linux builds default to parallel * Only install clog for dev, fix builds without logging * Only link include dirs to logged programs
- Loading branch information
1 parent
6ee2ec9
commit b00fb5e
Showing
299 changed files
with
55,442 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
add_library(logging_inc INTERFACE) | ||
target_link_libraries(inc INTERFACE logging_inc) | ||
|
||
if(QUIC_ENABLE_LOGGING) | ||
if(WIN32) | ||
target_link_libraries(inc INTERFACE MsQuicEtw_Header) | ||
add_library(logging INTERFACE) | ||
else() | ||
target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common) | ||
target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${QUIC_LTTNG_PLATFORM}) | ||
target_link_libraries(logging_inc INTERFACE ${LTTNGUST_INCLUDE_DIRS}) | ||
|
||
FILE(GLOB LOGGING_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${QUIC_LTTNG_PLATFORM}/*.c) | ||
add_library(logging STATIC ${LOGGING_FILES}) | ||
target_link_libraries(logging PRIVATE inc) | ||
|
||
add_library(msquic.lttng SHARED ${LOGGING_FILES}) | ||
target_compile_definitions(msquic.lttng PRIVATE BUILDING_TRACEPOINT_PROVIDER) | ||
target_link_libraries(msquic.lttng PRIVATE logging_inc inc) | ||
target_link_libraries(msquic.lttng PRIVATE ${LTTNGUST_LIBRARIES}) | ||
|
||
install(TARGETS msquic.lttng DESTINATION "${main_lib_dest}") | ||
endif() | ||
else() | ||
add_library(logging INTERFACE) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
# | ||
# Creates a target to build all generated clog files of the input | ||
# sources | ||
# | ||
function(CLOG_GENERATE_TARGET) | ||
set(library ${ARGV0}) | ||
set(library_type ${ARGV1}) | ||
list(REMOVE_AT ARGV 0) | ||
list(REMOVE_AT ARGV 0) | ||
# message(STATUS "****************<<<<<<< CLOG(${library})) >>>>>>>>>>>>>>>*******************") | ||
# message(STATUS ">>>> CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") | ||
# message(STATUS ">>>> CMAKE_CLOG_SIDECAR_DIRECTORY = ${CMAKE_CLOG_SIDECAR_DIRECTORY}") | ||
# message(STATUS ">>>> CMAKE_CLOG_CONFIG_PROFILE = ${CMAKE_CLOG_CONFIG_PROFILE}") | ||
# message(STATUS ">>>> CLOG Library = ${library}") | ||
# message(STATUS ">>>> CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") | ||
|
||
foreach(arg IN LISTS ARGV) | ||
get_filename_component(RAW_FILENAME ${arg} NAME) | ||
set(ARG_CLOG_FILE ${CMAKE_CLOG_OUTPUT_DIRECTORY}/${library}/${RAW_FILENAME}.clog.h) | ||
set(ARG_CLOG_C_FILE ${CMAKE_CLOG_OUTPUT_DIRECTORY}/${library}/${library}_${RAW_FILENAME}.clog.h.c) | ||
|
||
# message(STATUS ">>>>>>> CLOG Source File = ${RAW_FILENAME}") | ||
|
||
set(ARG_CLOG_DYNAMIC_TRACEPOINT "") | ||
if (${library_type} STREQUAL "DYNAMIC") | ||
set(ARG_CLOG_DYNAMIC_TRACEPOINT "--dynamicTracepointProvider") | ||
endif() | ||
|
||
add_custom_command( | ||
OUTPUT ${ARG_CLOG_FILE} ${ARG_CLOG_C_FILE} | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${arg} | ||
DEPENDS ${CMAKE_CLOG_CONFIG_FILE} | ||
DEPENDS ${CMAKE_CLOG_EXTRA_DEPENDENCIES} | ||
COMMENT "CLOG: clog --readOnly ${ARG_CLOG_DYNAMIC_TRACEPOINT} -p ${CMAKE_CLOG_CONFIG_PROFILE} --scopePrefix ${library} -c ${CMAKE_CLOG_CONFIG_FILE} -s ${CMAKE_CLOG_SIDECAR_DIRECTORY}/clog.sidecar -i ${CMAKE_CURRENT_SOURCE_DIR}/${arg} -o ${ARG_CLOG_FILE}" | ||
COMMAND clog --readOnly ${ARG_CLOG_DYNAMIC_TRACEPOINT} -p ${CMAKE_CLOG_CONFIG_PROFILE} --scopePrefix ${library} -c ${CMAKE_CLOG_CONFIG_FILE} -s ${CMAKE_CLOG_SIDECAR_DIRECTORY}/clog.sidecar -i ${CMAKE_CURRENT_SOURCE_DIR}/${arg} -o ${ARG_CLOG_FILE} | ||
) | ||
|
||
set_property(SOURCE ${arg} | ||
APPEND PROPERTY OBJECT_DEPENDS ${ARG_CLOG_FILE} | ||
) | ||
|
||
list(APPEND clogfiles ${ARG_CLOG_C_FILE}) | ||
endforeach() | ||
|
||
if (${library_type} STREQUAL "DYNAMIC") | ||
add_library(${library} STATIC ${clogfiles}) | ||
|
||
add_library("${library}.provider" OBJECT ${clogfiles}) | ||
target_compile_definitions("${library}.provider" PRIVATE BUILDING_TRACEPOINT_PROVIDER) | ||
set_property(TARGET "${library}.provider" PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
|
||
target_include_directories("${library}.provider" PUBLIC $<BUILD_INTERFACE:${CLOG_INCLUDE_DIRECTORY}>) | ||
target_include_directories("${library}.provider" PUBLIC $<BUILD_INTERFACE:${CMAKE_CLOG_OUTPUT_DIRECTORY}/${library}>) | ||
else() | ||
add_library(${library} ${library_type} ${clogfiles}) | ||
add_library("${library}.provider" INTERFACE) | ||
endif() | ||
|
||
target_link_libraries(${library} PUBLIC ${CMAKE_DL_LIBS}) | ||
target_include_directories(${library} PUBLIC $<BUILD_INTERFACE:${CLOG_INCLUDE_DIRECTORY}>) | ||
target_include_directories(${library} PUBLIC $<BUILD_INTERFACE:${CMAKE_CLOG_OUTPUT_DIRECTORY}/${library}>) | ||
|
||
# message(STATUS "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") | ||
endfunction() | ||
|
Oops, something went wrong.