From 8c3d1b3281336bf86cbd41e7811735e86a395704 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Wed, 15 Jun 2022 16:51:55 -0300 Subject: [PATCH] Don't build empty cpp files We shouldn't be compiling these .cpp files at all on other platforms, rather than compiling empty .cpp files (which later results in "... has no symbols" warnings). --- llarp/CMakeLists.txt | 5 +++-- llarp/util/logging/android_logger.cpp | 3 --- llarp/util/logging/win32_logger.cpp | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/llarp/CMakeLists.txt b/llarp/CMakeLists.txt index 40786322b..4d8f4106e 100644 --- a/llarp/CMakeLists.txt +++ b/llarp/CMakeLists.txt @@ -7,7 +7,6 @@ add_library(lokinet-util util/buffer.cpp util/fs.cpp util/json.cpp - util/logging/android_logger.cpp util/logging/buffer.cpp util/logging/file_logger.cpp util/logging/logger.cpp @@ -15,7 +14,6 @@ add_library(lokinet-util util/logging/loglevel.cpp util/logging/ostream_logger.cpp util/logging/syslog_logger.cpp - util/logging/win32_logger.cpp util/lokinet_init.c util/mem.cpp util/printer.cpp @@ -38,7 +36,10 @@ target_link_libraries(lokinet-util PUBLIC ) if(ANDROID) + target_sources(lokinet-util PRIVATE util/logging/android_logger.cpp) target_link_libraries(lokinet-util PUBLIC log) +elseif(WIN32) + target_sources(lokinet-util PRIVATE util/logging/win32_logger.cpp) endif() add_library(lokinet-platform diff --git a/llarp/util/logging/android_logger.cpp b/llarp/util/logging/android_logger.cpp index 3cf9343cb..ae4bdb793 100644 --- a/llarp/util/logging/android_logger.cpp +++ b/llarp/util/logging/android_logger.cpp @@ -1,5 +1,3 @@ -#if defined(ANDROID) - #include "android_logger.hpp" #include "logger_internal.hpp" @@ -69,4 +67,3 @@ namespace llarp } // namespace llarp } // namespace llarp -#endif diff --git a/llarp/util/logging/win32_logger.cpp b/llarp/util/logging/win32_logger.cpp index 2e0448c63..0792f8d92 100644 --- a/llarp/util/logging/win32_logger.cpp +++ b/llarp/util/logging/win32_logger.cpp @@ -1,4 +1,3 @@ -#if defined(_WIN32) #include "win32_logger.hpp" #include "logger_internal.hpp" @@ -113,4 +112,3 @@ namespace llarp } } // namespace llarp -#endif