diff --git a/App/CMakeLists.txt b/App/CMakeLists.txt index 170ad6f..d3c1854 100644 --- a/App/CMakeLists.txt +++ b/App/CMakeLists.txt @@ -8,4 +8,32 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Quick - Qt${QT_VERSION_MAJOR}::Qml) \ No newline at end of file + Qt${QT_VERSION_MAJOR}::Qml) + +if(ENABLE_ASAN) + message(STATUS "Building with AddressSanitizer") + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + message(FATAL_ERROR "ASan supported only with Clang/GCC") + endif() + + target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -fsanitize=address -fno-omit-frame-pointer) + target_link_options(${CMAKE_PROJECT_NAME} PRIVATE -fsanitize=address) +endif() + +if(ENABLE_CLANG_TIDY) + if(NOT DEFINED CLANG_TIDY) + if(DEFINED ENV{CLANG_TIDY}) + set(CLANG_TIDY $ENV{CLANG_TIDY}) + endif() + endif() + + find_program(CLANG_TIDY_EXE NAMES ${CLANG_TIDY} clang-tidy) + if(CLANG_TIDY_EXE) + message(STATUS "Plugin Found clang-tidy: ${CLANG_TIDY_EXE}") + else() + message(STATUS "clang-tidy not found") + endif() + if(CLANG_TIDY_EXE) + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=modernize-*,performance-*,readability-*,header-filter=.*;--warnings-as-errors=*;--extra-arg=-Qunused-arguments") + endif() +endif() \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fbeffe3..002194c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOU set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -22,7 +23,8 @@ set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} find_package(Qt6 6.8 REQUIRED COMPONENTS Core Gui Widgets Qml Quick QuickControls2 QuickTimeline ShaderTools) qt_standard_project_setup() -qt_add_executable(${CMAKE_PROJECT_NAME}) +qt_add_executable(${CMAKE_PROJECT_NAME} + README.md) qt_add_resources(${CMAKE_PROJECT_NAME} "configuration" PREFIX "/" FILES diff --git a/KomplexHubPlugin/CMakeLists.txt b/KomplexHubPlugin/CMakeLists.txt index 0cb2168..55ee5bb 100644 --- a/KomplexHubPlugin/CMakeLists.txt +++ b/KomplexHubPlugin/CMakeLists.txt @@ -10,15 +10,56 @@ qt_add_qml_module( VERSION 1.0 SOURCES - SettingsManager.h - SettingsManager.cpp - InstalledPackManager.h - InstalledPackManager.cpp - SOURCES WallpaperMetaData.h + settingsmanager.h + settingsmanager.cpp + installedpackmanager.h + installedpackmanager.cpp + common/wallpapercache.h + newestpacksmodel.h + newestpacksmodel.cpp + common/komplex_global.h + common/slidingcachecontroller.h + common/slidingcachecontroller.cpp + common/paginator.h + common/paginator.cpp + common/coreservices.h + common/coreservices.cpp + common/logging.h + common/fetchresult.h + paginators/newestpackspaginator.h + paginators/newestpackspaginator.cpp ) target_compile_definitions( KomplexHubPlugin PUBLIC KOMPLEX_PLUGIN -) \ No newline at end of file +) + +if(ENABLE_ASAN) + message(STATUS "Building with AddressSanitizer") + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + message(FATAL_ERROR "ASan supported only with Clang/GCC") + endif() + + target_compile_options(KomplexHubPlugin PRIVATE -fsanitize=address -fno-omit-frame-pointer) + target_link_options(KomplexHubPlugin PRIVATE -fsanitize=address) +endif() + +if(ENABLE_CLANG_TIDY) + if(NOT DEFINED CLANG_TIDY) + if(DEFINED ENV{CLANG_TIDY}) + set(CLANG_TIDY $ENV{CLANG_TIDY}) + endif() + endif() + + find_program(CLANG_TIDY_EXE NAMES ${CLANG_TIDY} clang-tidy) + if(CLANG_TIDY_EXE) + message(STATUS "Plugin Found clang-tidy: ${CLANG_TIDY_EXE}") + else() + message(STATUS "clang-tidy not found") + endif() + if(CLANG_TIDY_EXE) + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=modernize-*,performance-*,readability-*,header-filter=.*;--warnings-as-errors=*;--extra-arg=-Qunused-arguments") + endif() +endif() \ No newline at end of file