Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
18 changes: 15 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Move Assets/Songs folders and bass.dll x64
working-directory: ${{github.workspace}}/build_x64/Encore
run: move Assets Release/Assets ; move Songs Release/Songs ; move bass.dll Release/bass.dll ; move bassopus.dll Release/bassopus.dll ; move discord_game_sdk.dll Release/discord_game_sdk.dll
run: move Assets Release/Assets ; move Songs Release/Songs ; move bass.dll Release/bass.dll ; move bassopus.dll Release/bassopus.dll ; move discord_game_sdk.dll Release/discord_game_sdk.dll ; xcopy /E /I /Y ffmpeg\bin\*.dll Release\

- uses: actions/upload-artifact@v4
with:
Expand All @@ -56,7 +56,7 @@ jobs:

- name: Move Assets/Songs folders and bass.dll x86
working-directory: ${{github.workspace}}/build_x86/Encore
run: move Assets Release/Assets ; move Songs Release/Songs ; move bass.dll Release/bass.dll ; move bassopus.dll Release/bassopus.dll ; move discord_game_sdk.dll Release/discord_game_sdk.dll
run: move Assets Release/Assets ; move Songs Release/Songs ; move bass.dll Release/bass.dll ; move bassopus.dll Release/bassopus.dll ; move discord_game_sdk.dll Release/discord_game_sdk.dll ; xcopy /E /I /Y ffmpeg\bin\*.dll Release\

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -89,7 +89,19 @@ jobs:

- name: Remove CMake files x64
working-directory: ${{github.workspace}}/build_linux_x64/Encore
run: rm -r -f CMakeFiles Makefile cmake_install.cmake
run: |
# Remove CMake files
rm -r -f CMakeFiles Makefile cmake_install.cmake
# Copy FFmpeg .so files directly to the current directory
if [ -d "ffmpeg/lib" ]; then
for lib in libavcodec libavformat libavutil libswscale libswresample libavfilter libavdevice; do
find ffmpeg/lib -name "${lib}.so.[0-9]*" ! -name "*.100" ! -name "*.102" -exec cp {} . \; 2>/dev/null || true
done
fi
# Remove the ffmpeg directory to ensure it's not included
rm -rf ffmpeg
# Remove the ffmpeg directory to ensure it's not included
rm -rf ffmpeg

# - name: Configure CMake x86
# # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
3 changes: 2 additions & 1 deletion CHARTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ A fully fleshed out `info.json` file will look similar to the following:
{
"title": "Through the Fire and Flames",
"artist": "DragonForce",
"preview_start_time": 41727,
"preview_start_time": 41727,
"video_start_time": 1400,
"release_year": "2006",
"source": "rb3dlc",
"album": "Inhuman Rampage",
Expand Down
142 changes: 125 additions & 17 deletions Encore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CMakeList.txt : CMake project for Encore, include source and define
# CMakeList.txt : CMake project for Encore, include source and define
# project specific logic here.
#

Expand Down Expand Up @@ -42,6 +42,22 @@ if (NOT json_FOUND)
endif()
endif()

if(WIN32)
FetchContent_Declare(
zlib
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG v1.3.1
)
set(ZLIB_BUILD_EXAMPLES OFF CACHE BOOL "Z" FORCE)
FetchContent_MakeAvailable(zlib)
endif()

include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/setup-ffmpeg.cmake)
setup_ffmpeg()
find_ffmpeg_libraries()



option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ON)
# Add all subdirectories of src

Expand All @@ -53,48 +69,71 @@ if (WIN32)
else()
add_executable(Encore ${SRC_FILES} ${INC_FILES})
endif()
# Temp player file

file(COPY "Songs" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
file(COPY "Assets" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
# Set the include directory for the executable
target_include_directories(Encore PRIVATE "include" "src")

target_include_directories(Encore PRIVATE "include" "src" ${FFMPEG_INCLUDE_DIR})
if(WIN32)
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(DISCORD_GAME_SDK NAMES discord_game_sdk PATHS "lib/discord-rpc/windows/x86/")
file(COPY "lib/discord-rpc/windows/x86/discord_game_sdk.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/discord-rpc/windows/x86/discord_game_sdk.dll")
file(COPY "lib/discord-rpc/windows/x86/discord_game_sdk.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASS NAMES bass PATHS "lib/bass/windows/x86/")
file(COPY "lib/bass/windows/x86/bass.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/windows/x86/bass.dll")
file(COPY "lib/bass/windows/x86/bass.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASSOPUS NAMES bassopus PATHS "lib/bass/windows/x86/")
file(COPY "lib/bass/windows/x86/bassopus.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/windows/x86/bassopus.dll")
file(COPY "lib/bass/windows/x86/bassopus.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(DISCORD_GAME_SDK NAMES discord_game_sdk PATHS "lib/discord-rpc/windows/x64/")
file(COPY "lib/discord-rpc/windows/x64/discord_game_sdk.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/discord-rpc/windows/x64/discord_game_sdk.dll")
file(COPY "lib/discord-rpc/windows/x64/discord_game_sdk.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASS NAMES bass PATHS "lib/bass/windows/x64/")
file(COPY "lib/bass/windows/x64/bass.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/windows/x64/bass.dll")
file(COPY "lib/bass/windows/x64/bass.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASSOPUS NAMES bassopus PATHS "lib/bass/windows/x64/")
file(COPY "lib/bass/windows/x64/bassopus.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/windows/x64/bassopus.dll")
file(COPY "lib/bass/windows/x64/bassopus.dll" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
endif()
endif()
if(UNIX AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(DISCORD_GAME_SDK NAMES discord_game_sdk PATHS "lib/discord-rpc/linux/x64")
file(COPY "lib/discord-rpc/linux/x64/libdiscord_game_sdk.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/discord-rpc/linux/x64/libdiscord_game_sdk.so")
file(COPY "lib/discord-rpc/linux/x64/libdiscord_game_sdk.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASS NAMES bass PATHS "lib/bass/linux/x86_64")
file(COPY "lib/bass/linux/x86_64/libbass.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/linux/x86_64/libbass.so")
file(COPY "lib/bass/linux/x86_64/libbass.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASSOPUS NAMES bassopus PATHS "lib/bass/linux/x86_64")
file(COPY "lib/bass/linux/x86_64/libbassopus.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/linux/x86_64/libbassopus.so")
file(COPY "lib/bass/linux/x86_64/libbassopus.so" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath='$ORIGIN'")
endif()
endif()
if(APPLE)
find_library(DISCORD_GAME_SDK NAMES discord_game_sdk PATHS "lib/discord-rpc/macos")
file(COPY "lib/discord-rpc/macos/libdiscord_game_sdk.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/discord-rpc/macos/libdiscord_game_sdk.dylib")
file(COPY "lib/discord-rpc/macos/libdiscord_game_sdk.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASS NAMES bass PATHS "lib/bass/macos")
file(COPY "lib/bass/macos/libbass.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/macos/libbass.dylib")
file(COPY "lib/bass/macos/libbass.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
find_library(BASSOPUS NAMES bassopus PATHS "lib/bass/macos")
file(COPY "lib/bass/macos/libbassopus.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/bass/macos/libbassopus.dylib")
file(COPY "lib/bass/macos/libbassopus.dylib" DESTINATION ${CMAKE_BINARY_DIR}/Encore)
endif()
endif()

# Get the current working branch
Expand Down Expand Up @@ -128,5 +167,74 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE

set_property(TARGET Encore PROPERTY CXX_STANDARD 20)

target_link_libraries(Encore raylib nlohmann_json::nlohmann_json ${BASS} ${BASSOPUS} ${DISCORD_GAME_SDK})

set(ENCORE_LIBRARIES
raylib
nlohmann_json::nlohmann_json
${BASS}
${BASSOPUS}
${DISCORD_GAME_SDK}
${FFMPEG_LIBRARIES}
)
if(UNIX AND NOT APPLE)
find_package(ZLIB REQUIRED)
list(APPEND ENCORE_LIBRARIES ZLIB::ZLIB)
endif()
if(APPLE)
find_package(ZLIB REQUIRED)
list(APPEND ENCORE_LIBRARIES ZLIB::ZLIB)


find_library(COREFOUNDATION_FRAMEWORK CoreFoundation)
find_library(COREMEDIA_FRAMEWORK CoreMedia)
find_library(COREVIDEO_FRAMEWORK CoreVideo)
find_library(AUDIOTOOLBOX_FRAMEWORK AudioToolbox)
find_library(VIDEOTOOLBOX_FRAMEWORK VideoToolbox)
find_library(SECURITY_FRAMEWORK Security)
find_library(APPKIT_FRAMEWORK AppKit)
find_library(IOKIT_FRAMEWORK IOKit)

list(APPEND ENCORE_LIBRARIES
${COREFOUNDATION_FRAMEWORK}
${COREMEDIA_FRAMEWORK}
${COREVIDEO_FRAMEWORK}
${AUDIOTOOLBOX_FRAMEWORK}
${VIDEOTOOLBOX_FRAMEWORK}
${SECURITY_FRAMEWORK}
${APPKIT_FRAMEWORK}
${IOKIT_FRAMEWORK}
)

list(APPEND ENCORE_LIBRARIES "-liconv" "-lbz2" "-llzma")
endif()
if(WIN32)
list(APPEND ENCORE_LIBRARIES zlibstatic bcrypt)
endif()
if(UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-fatal-warnings")
endif()
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
endif()

target_link_libraries(Encore PRIVATE ${ENCORE_LIBRARIES})

if(UNIX AND NOT APPLE)
set_target_properties(Encore PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH "$ORIGIN"
INSTALL_RPATH_USE_LINK_PATH FALSE
)
endif()

# Set up runtime output directories
# Set up runtime output directories - all platforms use the same structure
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Encore)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Encore)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Encore)

# Set up post-build steps
setup_all_post_build(Encore ${CMAKE_BINARY_DIR}/Encore)



21 changes: 21 additions & 0 deletions Encore/scripts/copy-ffmpeg-libs-macos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

set(FFMPEG_LIB_DIR "$ENV{FFMPEG_LIB_DIR}")
set(TARGET_DIR "$ENV{TARGET_DIR}")

if(FFMPEG_LIB_DIR AND TARGET_DIR)
file(GLOB FFMPEG_DYLIB_FILES "${FFMPEG_LIB_DIR}/*.dylib")

if(FFMPEG_DYLIB_FILES)
list(LENGTH FFMPEG_DYLIB_FILES NUM_FILES)
message(STATUS "Copying ${NUM_FILES} FFmpeg .dylib files...")
foreach(DYLIB_FILE ${FFMPEG_DYLIB_FILES})
get_filename_component(FILENAME ${DYLIB_FILE} NAME)
message(STATUS " Copying ${FILENAME}")
file(COPY ${DYLIB_FILE} DESTINATION ${TARGET_DIR})
endforeach()
else()
message(STATUS "No FFmpeg .dylib files found in ${FFMPEG_LIB_DIR}")
endif()
else()
message(STATUS "FFMPEG_LIB_DIR or TARGET_DIR not set")
endif()
Loading