Skip to content

Commit

Permalink
Fix clog builds still happening if logging is disabled because of asan (
Browse files Browse the repository at this point in the history
microsoft#1119)

This actually causes a pretty huge degredation in build times, because the clog files take a long time to compile with asan. The variable was getting read before being modified when asan was being used
  • Loading branch information
ThadHouse authored Dec 24, 2020
1 parent 0446d4d commit ec96c02
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${QUIC_OUTPUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${QUIC_OUTPUT_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${QUIC_OUTPUT_DIR})

if (QUIC_ENABLE_LOGGING)
execute_process(COMMAND clog --installDirectory ${QUIC_BUILD_DIR}/clog)

set(CMAKE_CLOG_OUTPUT_DIRECTORY ${QUIC_BUILD_DIR}/inc)
set(CMAKE_CLOG_SIDECAR_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/manifest)
set(CLOG_INCLUDE_DIRECTORY ${QUIC_BUILD_DIR}/clog)
set(CMAKE_CLOG_GENERATE_FILE ${QUIC_BUILD_DIR}/clog/CLog.cmake)
set(CMAKE_CLOG_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/manifest/msquic.clog_config)
include(${CMAKE_CLOG_GENERATE_FILE})

function(add_clog_library)
CLOG_GENERATE_TARGET(${ARGV})
target_link_libraries(${ARGV0} PRIVATE inc)
set_property(TARGET ${ARGV0} PROPERTY FOLDER "clog")
endfunction()
else()
function(add_clog_library)
add_library(${ARGV0} INTERFACE)
endfunction()
endif()

set(QUIC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/inc)
set(MANIFESTED_HEADER_FILENAME ${QUIC_BUILD_DIR}/inc/MsQuicEtw.h)

Expand Down Expand Up @@ -523,6 +502,27 @@ if(QUIC_TLS STREQUAL "openssl")
endif()
endif()

if (QUIC_ENABLE_LOGGING)
execute_process(COMMAND clog --installDirectory ${QUIC_BUILD_DIR}/clog)

set(CMAKE_CLOG_OUTPUT_DIRECTORY ${QUIC_BUILD_DIR}/inc)
set(CMAKE_CLOG_SIDECAR_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/manifest)
set(CLOG_INCLUDE_DIRECTORY ${QUIC_BUILD_DIR}/clog)
set(CMAKE_CLOG_GENERATE_FILE ${QUIC_BUILD_DIR}/clog/CLog.cmake)
set(CMAKE_CLOG_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/manifest/msquic.clog_config)
include(${CMAKE_CLOG_GENERATE_FILE})

function(add_clog_library)
CLOG_GENERATE_TARGET(${ARGV})
target_link_libraries(${ARGV0} PRIVATE inc)
set_property(TARGET ${ARGV0} PROPERTY FOLDER "clog")
endfunction()
else()
function(add_clog_library)
add_library(${ARGV0} INTERFACE)
endfunction()
endif()

if(QUIC_TLS STREQUAL "mitls")
# Build Everest.
add_subdirectory(submodules/everest/msquic/msvc/kremlib)
Expand Down

0 comments on commit ec96c02

Please sign in to comment.