Add XMPlay CMake script, fix bug, cleanup

This commit is contained in:
Naram Qashat 2019-03-17 19:38:06 -04:00
parent 78748393db
commit 4fc51407e9
7 changed files with 62 additions and 7 deletions

View File

@ -37,6 +37,7 @@ if(WIN32)
set(FB2K_SDK_PATH CACHE PATH "Path to foobar2000 SDK")
set(WTL_INCLUDE_PATH CACHE PATH "Path to WTL include directory")
option(BUILD_WINAMP "Build Winamp plugin" ON)
option(BUILD_XMPLAY "Build XMPlay plugin" ON)
endif()
if(WIN32)
@ -174,6 +175,9 @@ if(WIN32)
include_external_msproject(pfc ${FB2K_SDK_PATH}/pfc/pfc.vcxproj)
add_subdirectory(fb2k)
endif()
if(BUILD_XMPLAY)
add_subdirectory(xmplay)
endif()
endif()
if(BUILD_CLI)
if(WIN32)
@ -205,5 +209,6 @@ message(STATUS " CLI: ${BUILD_CLI}")
if(WIN32)
message(STATUS "foobar2000 component: ${BUILD_FB2K}")
message(STATUS " Winamp plugin: ${BUILD_WINAMP}")
message(STATUS " XMPlay plugin: ${BUILD_XMPLAY}")
endif()
message(STATUS "")

View File

@ -121,7 +121,6 @@ macro(setup_target TARGET)
target_link_libraries(${TARGET}
${CMAKE_BINARY_DIR}/ext_libs/libcelt-0061.lib
${CMAKE_BINARY_DIR}/ext_libs/libcelt-0110.lib)
endif()
endif()
endif()
endmacro()

View File

@ -1,10 +1,19 @@
# NOTE: Although this does include a section for handling MinGW, it might not be possible to build the foobar2000 component using MinGW using only CMake, as foobar2000's SDK only includes Visual Studio projects
set(RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/foo_input_vgmstream.rc)
# Setup source groups, mainly for Visual Studio
source_group("Resource Files" FILES ${RESOURCES})
add_library(foo_input_vgmstream SHARED
foo_filetypes.h
foo_prefs.h
foo_vgmstream.h
resource.h
foo_prefs.cpp
foo_streamfile.cpp
foo_vgmstream.cpp
foo_input_vgmstream.rc)
${RESOURCES})
setup_target(foo_input_vgmstream TRUE)

View File

@ -1,6 +1,15 @@
file(GLOB WINAMP_SDK_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/sdk/*.h")
set(RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/resource.rc)
# Setup source groups, mainly for Visual Studio
source_group("Header Files\\sdk" FILES ${WINAMP_SDK_HEADERS})
source_group("Resource Files" FILES ${RESOURCES})
add_library(in_vgmstream SHARED
${WINAMP_SDK_HEADERS}
resource.h
in_vgmstream.c
resource.rc)
${RESOURCES})
setup_target(in_vgmstream TRUE)

33
xmplay/CMakeLists.txt Normal file
View File

@ -0,0 +1,33 @@
add_library(xmp-vgmstream SHARED
xmpfunc.h
xmpin.h
xmp_vgmstream.c
xmpin.def)
setup_target(xmp-vgmstream TRUE)
# Remove the prefix and set the suffix to .dll
set_target_properties(xmp-vgmstream PROPERTIES
PREFIX ""
SUFFIX ".dll")
# Make sure that the binary directory is included (for version.h)
target_include_directories(xmp-vgmstream PRIVATE ${CMAKE_BINARY_DIR})
# Link to the vgmstream library
target_link_libraries(xmp-vgmstream libvgmstream)
# Include the version string
if(MSVC)
add_dependencies(xmp-vgmstream version_h)
elseif(MINGW)
if(VGMSTREAM_VERSION)
target_compile_definitions(xmp-vgmstream PRIVATE VERSION="${VGMSTREAM_VERSION}")
endif()
# Also, on MinGW when using GCC, these flags need to be included to prevent requiring MinGW's runtime DLLs from being included, which does unfortunately increase the size of the DLL
if(NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_target_properties(xmp-vgmstream PROPERTIES
LINK_FLAGS "-static-libgcc -static-libstdc++")
endif()
endif()

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@ -61,7 +61,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../ext_includes;$(DependenciesDir)/qaac/mp4v2/include;$(DependenciesDir)/fdk-aac/libSYS/include;$(DependenciesDir)/fdk-aac/libAACdec/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..;../ext_includes;$(DependenciesDir)/qaac/mp4v2/include;$(DependenciesDir)/fdk-aac/libSYS/include;$(DependenciesDir)/fdk-aac/libAACdec/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;VGM_USE_VORBIS;VGM_USE_MPEG;VGM_USE_FFMPEG;VGM_USE_G7221;VGM_USE_MP4V2;VGM_USE_FDKAAC;VGM_USE_ATRAC9;VGM_USE_CELT;_DEBUG;_WINDOWS;_USRDLL;IN_VGMSTREAM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -86,7 +86,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../ext_includes;$(DependenciesDir)/qaac/mp4v2/include;$(DependenciesDir)/fdk-aac/libSYS/include;$(DependenciesDir)/fdk-aac/libAACdec/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..;../ext_includes;$(DependenciesDir)/qaac/mp4v2/include;$(DependenciesDir)/fdk-aac/libSYS/include;$(DependenciesDir)/fdk-aac/libAACdec/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WIN32_WINNT=0x501;WIN32;VGM_USE_VORBIS;VGM_USE_MPEG;VGM_USE_FFMPEG;VGM_USE_G7221;VGM_USE_MP4V2;VGM_USE_FDKAAC;NDEBUG;_WINDOWS;_USRDLL;IN_VGMSTREAM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>

View File

@ -16,7 +16,7 @@
#ifndef VERSION
#include "../version.h"
#include "version.h"
#endif
#ifndef VERSION
#define VERSION "(unknown version)"