Skip to content

Commit

Permalink
make kaitai rekordbox code a library
Browse files Browse the repository at this point in the history
This makes it easier to ignore warnings in the autogenerated code.
It also makes more sense since the `*.ksy` files are effectively
vendored and the generated C++ files are autogenerated. Both
something that doesn't belong in `src/`.
  • Loading branch information
Swiftb0y committed May 30, 2024
1 parent 26ef892 commit 157feda
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 30 deletions.
30 changes: 8 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,6 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/library/recording/dlgrecording.cpp
src/library/recording/dlgrecording.ui
src/library/recording/recordingfeature.cpp
src/library/rekordbox/kaitaistructs/rekordbox_anlz.cpp
src/library/rekordbox/kaitaistructs/rekordbox_pdb.cpp
src/library/rekordbox/rekordboxfeature.cpp
src/library/rhythmbox/rhythmboxfeature.cpp
src/library/scanner/importfilestask.cpp
Expand Down Expand Up @@ -1576,26 +1574,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Enabling QML Debugging! This poses a security risk as Mixxx will open a TCP port for debugging")
endif()

# Disable warnings in generated source files
if(GNU_GCC OR LLVM_CLANG)
set_property(
SOURCE src/library/rekordbox/kaitaistructs/rekordbox_anlz.cpp
APPEND_STRING
PROPERTY COMPILE_OPTIONS -Wno-unused-parameter
)
set_property(
SOURCE src/library/rekordbox/kaitaistructs/rekordbox_pdb.cpp
APPEND_STRING
PROPERTY COMPILE_OPTIONS -Wno-unused-parameter -Wno-switch
)
elseif(MSVC)
set_property(
SOURCE src/library/rekordbox/kaitaistructs/rekordbox_pdb.cpp
APPEND_STRING
PROPERTY COMPILE_OPTIONS /wd4244
)
endif()

option(WARNINGS_PEDANTIC "Let the compiler show even more warnings" OFF)
if(MSVC)
if(WARNINGS_PEDANTIC)
Expand Down Expand Up @@ -2508,12 +2486,20 @@ target_link_libraries(mixxx-lib PRIVATE FpClassify)
find_package(mp3lame REQUIRED)
target_link_libraries(mixxx-lib PRIVATE mp3lame::mp3lame)

add_library(rekordbox_metadata STATIC EXCLUDE_FROM_ALL
lib/rekordbox-metadata/rekordbox_pdb.cpp
lib/rekordbox-metadata/rekordbox_anlz.cpp
)
target_include_directories(rekordbox_metadata SYSTEM PUBLIC lib/rekordbox-metadata)
target_link_libraries(mixxx-lib PRIVATE rekordbox_metadata)

# Kaitai for reading Rekordbox libraries
add_library(Kaitai STATIC EXCLUDE_FROM_ALL
lib/kaitai/kaitai/kaitaistream.cpp
)
target_include_directories(Kaitai SYSTEM PUBLIC lib/kaitai)
target_compile_definitions(Kaitai PRIVATE KS_STR_ENCODING_NONE)
target_link_libraries(rekordbox_metadata PRIVATE Kaitai)
target_link_libraries(mixxx-lib PRIVATE Kaitai)

# For determining MP3 timing offset cases in Rekordbox library feature
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions src/library/rekordbox/kaitaistructs/.clang-tidy

This file was deleted.

4 changes: 2 additions & 2 deletions src/library/rekordbox/rekordboxfeature.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "library/rekordbox/rekordboxfeature.h"

#include <mp3guessenc.h>
#include <rekordbox_anlz.h>
#include <rekordbox_pdb.h>

#include <QMap>
#include <QMessageBox>
Expand All @@ -13,8 +15,6 @@
#include "library/dao/trackschema.h"
#include "library/library.h"
#include "library/queryutil.h"
#include "library/rekordbox/kaitaistructs/rekordbox_anlz.h"
#include "library/rekordbox/kaitaistructs/rekordbox_pdb.h"
#include "library/rekordbox/rekordboxconstants.h"
#include "library/trackcollection.h"
#include "library/trackcollectionmanager.h"
Expand Down

0 comments on commit 157feda

Please sign in to comment.