Fix the -DENABLE_LOG=OFF building option

This commit is contained in:
Carles Fernandez 2020-07-05 11:53:20 +02:00
parent a82664d345
commit 303e95dd32
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 11 additions and 5 deletions

View File

@ -1581,6 +1581,13 @@ endif()
if(NOT ENABLE_LOG)
message(STATUS "Logging is not enabled")
if(CMAKE_VERSION VERSION_GREATER 3.11.0)
target_compile_definitions(Glog::glog INTERFACE -DGOOGLE_STRIP_LOG=1)
else()
set_property(TARGET Glog::glog APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS GOOGLE_STRIP_LOG=1
)
endif()
endif()

View File

@ -81,6 +81,10 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
per sample.
- Fixed a bug in signal sources that made the number of samples parameter
ignored when too large (that is, larger than 2^31-1).
- Fixed the building option `-DENABLE_LOG=OFF`, which strips internal logging
from the binary and can help to reduce its size and speed up the receiver. In
binaries with enabled logging, it can be still disabled by passing the command
line flag `--minloglevel=3` to `gnss-sdr`.
&nbsp;

View File

@ -38,11 +38,6 @@ target_link_libraries(gnss-sdr
target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
# Disable internal logging
if(NOT ENABLE_LOG)
target_compile_definitions(gnss-sdr PRIVATE -DGOOGLE_STRIP_LOG=1)
endif()
if(ENABLE_CUDA)
if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
target_link_libraries(gnss-sdr