From efb9d9dadd4b512e8cbb70fdc561d9640a830725 Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Wed, 11 Mar 2020 02:10:02 +0100 Subject: [PATCH] CMAKE: enable doxygen checks --- CMakeLists.txt | 11 ---------- cmake/common.cmake | 26 +++++++++++++++-------- src/modules/CMakeLists.txt | 5 +++++ src/modules/animation/AnimationSettings.h | 1 - src/modules/animation/SkeletonAttribute.h | 2 +- src/modules/core/App.h | 2 +- src/modules/core/command/Command.h | 2 +- src/modules/util/KeybindingHandler.cpp | 2 +- src/tools/databasetool/Generator.cpp | 3 ++- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc6b45262..b687318d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,17 +138,6 @@ if (MSVC) endforeach(flag_var) endif() -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Compile Type" FORCE) -endif() -set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo Profile) - -if (${CMAKE_BUILD_TYPE} MATCHES "Debug") - set(RELEASE False) -else() - set(RELEASE True) -endif() - # First for the generic no-config case (e.g. with mingw) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib) diff --git a/cmake/common.cmake b/cmake/common.cmake index b3be64ee4..a5504030a 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -13,11 +13,26 @@ set(CMAKE_CXX_STANDARD_REQUIRED on) set(CMAKE_CXX_EXTENSIONS off) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Compile Type" FORCE) +endif() +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo Profile) + +if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set(RELEASE False) +else() + set(RELEASE True) +endif() + include(CheckIPOSupported) check_ipo_supported(RESULT HAVE_LTO OUTPUT error) if (HAVE_LTO) - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) - message(STATUS "IPO / LTO enabled") + if (${CMAKE_BUILD_TYPE} MATCHES "Release") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + message(STATUS "IPO / LTO enabled") + else() + message(STATUS "IPO / LTO only enabled in release builds") + endif() else() message(STATUS "IPO / LTO not supported: <${error}>") endif() @@ -46,13 +61,6 @@ if (C_COMPILER_SUPPORTS_FIXITS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-parseable-fixits") endif() -if (USE_DOXYGEN_CHECK) - check_cxx_compiler_flag("-Wdocumentation" COMPILER_SUPPORTS_WDOCUMENTATION) - if (COMPILER_SUPPORTS_WDOCUMENTATION) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation") - endif() -endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2 -D__STDC_FORMAT_MACROS") check_c_compiler_flag("-fexpensive-optimizations" HAVE_EXPENSIVE_OPTIMIZATIONS) diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index e18fdfa49..fd187530d 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -2,6 +2,11 @@ # If you don't include the module with files before its dependent modules, then the # files will not get copied +check_cxx_compiler_flag("-Wdocumentation" COMPILER_SUPPORTS_WDOCUMENTATION) +if (COMPILER_SUPPORTS_WDOCUMENTATION) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdocumentation") +endif() + add_subdirectory(core) add_subdirectory(uuid) add_subdirectory(console) diff --git a/src/modules/animation/AnimationSettings.h b/src/modules/animation/AnimationSettings.h index ce2ab51f5..90b1f04f2 100644 --- a/src/modules/animation/AnimationSettings.h +++ b/src/modules/animation/AnimationSettings.h @@ -109,7 +109,6 @@ inline AnimationSettings::Type AnimationSettings::type() const { /** * @brief Load the given lua string and fill the AnimationSettings values as well as the skeleton attributes identified by the via base pointer and the meta data iterator - * @param[in] luaString * @param[out] settings the AnimationSettings to fill * @param[out] skeletonAttr The base pointer to the skeleton attributes * @return @c true on success, @c false on failure diff --git a/src/modules/animation/SkeletonAttribute.h b/src/modules/animation/SkeletonAttribute.h index b390fd30a..20053baad 100644 --- a/src/modules/animation/SkeletonAttribute.h +++ b/src/modules/animation/SkeletonAttribute.h @@ -36,7 +36,7 @@ enum class SkeletonAttributeType : int32_t { */ struct SkeletonAttribute { /** - * @param[in] type The type of the skeleton + * @param[in] _type The type of the skeleton * @param[in] metaArray Null terminated (@sa SKELETONATTRIBUTE_END) array of SkeletonAttributeMeta entries */ SkeletonAttribute(SkeletonAttributeType _type, const SkeletonAttributeMeta *metaArray) : diff --git a/src/modules/core/App.h b/src/modules/core/App.h index b6f95c837..4495bcd45 100644 --- a/src/modules/core/App.h +++ b/src/modules/core/App.h @@ -108,7 +108,7 @@ protected: uint64_t _nextFrameMillis = 0ul; /** * @brief There is no fps limit per default, but you set one on a per-app basis - * @param[in] framesPerSecondsCap The frames to cap the application loop at + * The frames to cap the application loop at */ core::VarPtr _framesPerSecondsCap; diff --git a/src/modules/core/command/Command.h b/src/modules/core/command/Command.h index 2378b4458..7eb4e7b9f 100644 --- a/src/modules/core/command/Command.h +++ b/src/modules/core/command/Command.h @@ -75,7 +75,7 @@ public: * @brief Registers two commands prefixed with @c + and @c - (for pressed and released) * for commands that are bound to keys. * @param[in] name The name of the command. It will automatically be prefixed with - * a @c + and @c + * a @c + and @c - * @param[in,out] button The @c ActionButton instance. * @note This class is not taking ownership of the button instance. You have to ensure * that the instance given here is alive as long as the commands are bound. diff --git a/src/modules/util/KeybindingHandler.cpp b/src/modules/util/KeybindingHandler.cpp index 67cf84369..08ac713d4 100644 --- a/src/modules/util/KeybindingHandler.cpp +++ b/src/modules/util/KeybindingHandler.cpp @@ -58,7 +58,7 @@ bool isValidForBinding(int16_t pressedModMask, int16_t commandModMask) { /** * @param bindings Map of bindings * @param key The key that was pressed - * @param modifier The modifier mask + * @param modMask The modifier mask * @return @c true if the key+modifier combination lead to a command execution via * key bindings, @c false otherwise */ diff --git a/src/tools/databasetool/Generator.cpp b/src/tools/databasetool/Generator.cpp index 6c7834aeb..2b20e005f 100644 --- a/src/tools/databasetool/Generator.cpp +++ b/src/tools/databasetool/Generator.cpp @@ -291,11 +291,12 @@ static void createDBConditions(const Table& table, core::String& src) { src += "\tusing Super = persistence::DBCondition;\n"; src += "public:\n"; src += "\t/**\n\t * @brief Condition for " + f.name + "\n"; - src += "\t * @param[in] value"; if (f.type == persistence::FieldType::TIMESTAMP) { + src += "\t * @param[in] value"; src += " UTC timestamp in seconds"; } else if (isString(f)) { if (f.isLower()) { + src += "\t * @param[in] value"; src += " The given value is converted to lowercase before the comparison takes place"; } }