Skip to content

Commit

Permalink
Minimize amount of code to rebuild when switching options
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Sep 22, 2023
1 parent 28db382 commit 6de11e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,11 @@ PRIVATE
base/crash_report_writer.h
)

if (DESKTOP_APP_DISABLE_CRASH_REPORTS)
remove_target_sources(lib_base_crash_report_writer ${src_loc}
base/crash_report_writer.cpp
base/crash_report_writer.h
)
endif()

target_link_libraries(lib_base_crash_report_writer PUBLIC desktop-app::lib_base)
4 changes: 0 additions & 4 deletions base/crash_report_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//
#include "base/crash_report_writer.h"

#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS

#include "base/platform/base_platform_info.h"
#include "base/integration.h"
#include "base/crash_report_header.h"
Expand Down Expand Up @@ -460,5 +458,3 @@ std::optional<QByteArray> CrashReportWriter::readPreviousReport() {
}

} // namespace CrashReports

#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
6 changes: 1 addition & 5 deletions base/crash_report_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//
#pragma once

#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS

#include "base/file_lock.h"

namespace base {
Expand Down Expand Up @@ -37,6 +35,4 @@ class CrashReportWriter final {

};

} // namespace base

#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
} // namespace base

0 comments on commit 6de11e6

Please sign in to comment.