Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some warnings #25670

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 47 additions & 33 deletions buildscripts/cmake/DeclareModuleSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ macro(declare_module name)
unset(MODULE_SRC)
unset(MODULE_LINK)
set(MODULE_LINK_GLOBAL ON)
set(MODULE_USE_QT ON)
unset(MODULE_QRC)
unset(MODULE_BIG_QRC)
unset(MODULE_UI)
Expand All @@ -67,15 +68,23 @@ macro(declare_module name)
set(MODULE_USE_COVERAGE ON)
endmacro()

macro(declare_thirdparty_module name)
declare_module(${name})
set(MODULE_USE_QT OFF)
set(MODULE_LINK_GLOBAL OFF)
set(MODULE_USE_PCH OFF)
set(MODULE_USE_COVERAGE OFF)
endmacro()


macro(add_qml_import_path input_var)
if (NOT ${${input_var}} STREQUAL "")
set(QML_IMPORT_PATH "$CACHE{QML_IMPORT_PATH}")
list(APPEND QML_IMPORT_PATH ${${input_var}})
list(REMOVE_DUPLICATES QML_IMPORT_PATH)
set(QML_IMPORT_PATH "${QML_IMPORT_PATH}" CACHE STRING
"QtCreator extra import paths for QML modules" FORCE)
endif()
if (NOT ${${input_var}} STREQUAL "")
set(QML_IMPORT_PATH "$CACHE{QML_IMPORT_PATH}")
list(APPEND QML_IMPORT_PATH ${${input_var}})
list(REMOVE_DUPLICATES QML_IMPORT_PATH)
set(QML_IMPORT_PATH "${QML_IMPORT_PATH}" CACHE STRING
"QtCreator extra import paths for QML modules" FORCE)
endif()
endmacro()


Expand All @@ -87,26 +96,6 @@ macro(setup_module)
message(STATUS "Configuring ${MODULE} <${MODULE_ALIAS}>")
endif()

if (NOT MUSE_FRAMEWORK_PATH)
set(MUSE_FRAMEWORK_PATH ${PROJECT_SOURCE_DIR})
endif()

if (MODULE_QRC AND NOT NO_QT_SUPPORT)
qt_add_resources(RCC_SOURCES ${MODULE_QRC})
endif()

if (MODULE_BIG_QRC AND NOT NO_QT_SUPPORT)
qt_add_big_resources(RCC_BIG_SOURCES ${MODULE_BIG_QRC})
endif()

if (MODULE_UI)
find_package(Qt6Widgets)
QT6_WRAP_UI(ui_headers ${MODULE_UI} )
endif()

add_qml_import_path(MODULE_QML_IMPORT)
add_qml_import_path(MODULE_QMLAPI_IMPORT)

if (CC_IS_EMSCRIPTEN)
add_library(${MODULE} OBJECT)
else()
Expand All @@ -117,10 +106,36 @@ macro(setup_module)
add_library(${MODULE_ALIAS} ALIAS ${MODULE})
endif()

if (MODULE_USE_QT AND QT_SUPPORT)
if (MODULE_QRC AND NOT NO_QT_SUPPORT)
qt_add_resources(RCC_SOURCES ${MODULE_QRC})
endif()

if (MODULE_BIG_QRC AND NOT NO_QT_SUPPORT)
qt_add_big_resources(RCC_BIG_SOURCES ${MODULE_BIG_QRC})
endif()
else()
set(RCC_SOURCES)
set(RCC_BIG_SOURCES)

set_target_properties(${MODULE} PROPERTIES
AUTOMOC OFF
AUTOUIC OFF
AUTORCC OFF
)
endif()

add_qml_import_path(MODULE_QML_IMPORT)
add_qml_import_path(MODULE_QMLAPI_IMPORT)

if (BUILD_SHARED_LIBS)
install(TARGETS ${MODULE} DESTINATION ${SHARED_LIBS_INSTALL_DESTINATION})
endif()

if (NOT MUSE_FRAMEWORK_PATH)
set(MUSE_FRAMEWORK_PATH ${PROJECT_SOURCE_DIR})
endif()

if (MUSE_COMPILE_USE_PCH AND MODULE_USE_PCH)
if (${MODULE} STREQUAL muse_global)
target_precompile_headers(${MODULE} PRIVATE ${MUSE_FRAMEWORK_PATH}/buildscripts/pch/pch.h)
Expand Down Expand Up @@ -149,7 +164,7 @@ macro(setup_module)
${RCC_SOURCES}
${RCC_BIG_SOURCES}
${MODULE_SRC}
)
)

target_include_directories(${MODULE} PUBLIC
${PROJECT_BINARY_DIR}
Expand Down Expand Up @@ -188,11 +203,10 @@ macro(setup_module)
endif()

if (NOT ${MODULE} MATCHES muse_global AND MODULE_LINK_GLOBAL)
set(MODULE_LINK muse_global ${MODULE_LINK})
target_link_libraries(${MODULE} PRIVATE muse_global)
endif()

set(MODULE_LINK ${CMAKE_DL_LIBS} ${QT_LIBRARIES} ${MODULE_LINK})

target_link_libraries(${MODULE} PRIVATE ${MODULE_LINK} ${COVERAGE_FLAGS})

target_link_libraries(${MODULE}
PRIVATE ${MODULE_LINK} ${CMAKE_DL_LIBS} ${QT_LIBRARIES} ${COVERAGE_FLAGS}
)
endmacro()
2 changes: 1 addition & 1 deletion buildscripts/cmake/SetupSndFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ elseif (OS_IS_WASM)
set(LIBVORBIS_PATH "" CACHE PATH "Path to libogg sources")
set(SNDFILE_INCDIR LIBSND_PATH)

declare_module(sndfile)
declare_thirdparty_module(sndfile)

set(MODULE_SRC
${LIBSND_PATH}/sndfile.c
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/packaging/macOS/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ find "${VOLUME}/${LONGER_NAME}.app/Contents/Resources" -name '*.dylib' -exec cod
# Sign code in other (more conventional) locations
codesign --force --options runtime --entitlements "${WORKING_DIRECTORY}/../buildscripts/packaging/macOS/entitlements.plist" --deep -s "Developer ID Application: MuseScore" "${VOLUME}/${LONGER_NAME}.app"
echo "spctl"
spctl --assess --type execute "${VOLUME}/${LONGER_NAME}.app"
spctl --assess --type execute -vvv "${VOLUME}/${LONGER_NAME}.app"
echo "Codesign verify"
codesign --verify --deep --strict --verbose=2 "${VOLUME}/${LONGER_NAME}.app"

Expand Down
3 changes: 1 addition & 2 deletions src/braille/thirdparty/liblouis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare_module(liblouis)
declare_thirdparty_module(liblouis)

add_subdirectory(tables)

Expand Down Expand Up @@ -36,7 +36,6 @@ set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/liblouis/utils.c
)

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
4 changes: 2 additions & 2 deletions src/engraving/compat/midi/midipatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ namespace mu::engraving {

struct MidiPatch {
bool drum;
String synti;
muse::String synti;
int bank, prog, sfid;
String name;
muse::String name;
};
}
#endif
3 changes: 0 additions & 3 deletions src/engraving/dom/actionicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#include "actionicon.h"

#include "property.h"
#include "score.h"

#include "log.h"

using namespace mu;
using namespace muse::draw;
Expand Down
1 change: 0 additions & 1 deletion src/engraving/dom/drumset.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#ifndef MU_ENGRAVING_DRUMSET_H
#define MU_ENGRAVING_DRUMSET_H

#include "mscore.h"
#include "pitchspelling.h"
#include "../types/types.h"

Expand Down
4 changes: 2 additions & 2 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@
#include "system.h"
#include "systemtext.h"
#include "tempotext.h"
#include "text.h"
#include "textline.h"
#include "tie.h"
#include "tiemap.h"
#include "timesig.h"

#include "tremolotwochord.h"
#include "tremolosinglechord.h"
#include "tremolotwochord.h"
#include "trill.h"
#include "tuplet.h"
#include "tupletmap.h"
Expand Down
1 change: 1 addition & 0 deletions src/engraving/dom/lyrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "segment.h"
#include "staff.h"
#include "system.h"
#include "text.h"
#include "textedit.h"
#include "undo.h"
#include "utils.h"
Expand Down
5 changes: 0 additions & 5 deletions src/engraving/dom/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "bracket.h"
#include "chord.h"
#include "clef.h"
#include "capo.h"
#include "engravingitem.h"
#include "excerpt.h"
#include "fret.h"
Expand All @@ -59,12 +58,9 @@
#include "noteevent.h"
#include "page.h"
#include "part.h"
#include "partialtie.h"
#include "rest.h"
#include "score.h"
#include "segment.h"
#include "select.h"
#include "sig.h"
#include "spanner.h"
#include "staff.h"
#include "stafflines.h"
Expand All @@ -76,7 +72,6 @@
#include "textline.h"
#include "tie.h"

#include "tremolobar.h"
#include "tuplet.h"
#include "utils.h"

Expand Down
6 changes: 0 additions & 6 deletions src/engraving/dom/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

#include <map>

#include "modularity/ioc.h"
#include "../iengravingfontsprovider.h"

#include "../style/style.h"
#include "../compat/midi/midipatch.h"

Expand Down Expand Up @@ -59,12 +56,9 @@
#include "stafftype.h"
#include "stringdata.h"
#include "stringtunings.h"
#include "synthesizerstate.h"
#include "soundflag.h"
#include "text.h"

#include "tremolotwochord.h"
#include "tremolobar.h"

namespace mu::engraving {
class Bend;
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/tests/links_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "dom/part.h"
#include "dom/segment.h"
#include "dom/tempotext.h"
#include "dom/text.h"
#include "dom/undo.h"
#include "utils/scorerw.h"
#include "utils/scorecomp.h"

using namespace mu;
using namespace mu::engraving;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

using namespace muse;
using namespace muse::audio;
static constexpr char DEFAULT_DEVICE_ID[] = "Systems default";

struct OSXAudioDriver::Data {
Spec format;
Expand Down
4 changes: 1 addition & 3 deletions src/framework/audio/thirdparty/flac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

declare_module(flac)
declare_thirdparty_module(flac)

include(GetPlatformInfo)
include(GetCompilerInfo)
Expand Down Expand Up @@ -68,7 +67,6 @@ set (MODULE_SRC
$<$<BOOL:${OS_IS_WIN}>:${FLAC_SRC}/share/win_utf8_io/win_utf8_io.c>
)

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
4 changes: 1 addition & 3 deletions src/framework/audio/thirdparty/fluidsynth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

declare_module(fluidsynth)
declare_thirdparty_module(fluidsynth)

include(${CMAKE_CURRENT_LIST_DIR}/fluidsynth.cmake)

Expand All @@ -23,7 +22,6 @@ set(MODULE_LINK
${SNDFILE_LIB}
)

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
4 changes: 1 addition & 3 deletions src/framework/audio/thirdparty/lame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

declare_module(lame)
declare_thirdparty_module(lame)

include(GetPlatformInfo)
include(GetCompilerInfo)
Expand Down Expand Up @@ -56,7 +55,6 @@ set (MODULE_SRC
${SOURCE_LIB}
)

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
4 changes: 1 addition & 3 deletions src/framework/audio/thirdparty/opusenc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

declare_module(opusenc)
declare_thirdparty_module(opusenc)

include(GetPlatformInfo)
include(GetCompilerInfo)
Expand Down Expand Up @@ -32,7 +31,6 @@ set(MODULE_SRC

set(MODULE_LINK ${OPUS_LIBRARIES})

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
6 changes: 6 additions & 0 deletions src/framework/audio/thirdparty/opusenc/cmake/SetupOpus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ endif()
set(OPUS_INCLUDE_DIRS ${OPUS_LIB_DIR}/include)
set(OPUS_LIBRARIES opus)

set_target_properties(opus PROPERTIES
AUTOMOC OFF
AUTOUIC OFF
AUTORCC OFF
)

target_no_warning(opus -Wno-conversion)
target_no_warning(opus -Wno-truncate)
target_no_warning(opus -Wno-uninitialized)
3 changes: 1 addition & 2 deletions src/framework/draw/thirdparty/freetype/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

declare_module(freetype)
declare_thirdparty_module(freetype)

set(FREETYPE_DIR ${CMAKE_CURRENT_LIST_DIR}/freetype-2.13.1)
set(FREETYPE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/freetype-2.13.1)
Expand Down Expand Up @@ -160,7 +160,6 @@ set(MODULE_DEF
-DFT2_BUILD_LIBRARY
)

set(MODULE_USE_PCH OFF)
set(MODULE_USE_UNITY OFF)
set(MODULE_USE_COVERAGE OFF)

Expand Down
6 changes: 1 addition & 5 deletions src/framework/uicomponents/view/abstractmenumodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MUSE_UICOMPONENTS_ABSTRACTMENUMODEL_H
#define MUSE_UICOMPONENTS_ABSTRACTMENUMODEL_H
#pragma once

#include <QAbstractListModel>

#include "async/asyncable.h"
#include "ui/uitypes.h"
#include "menuitem.h"

#include "modularity/ioc.h"
Expand Down Expand Up @@ -106,5 +104,3 @@ class AbstractMenuModel : public QAbstractListModel, public muse::Injectable, pu
MenuItemList m_items;
};
}

#endif // MUSE_UICOMPONENTS_ABSTRACTMENUMODEL_H
Loading