Commit 1cb968a7 authored by Виталий Кирсанов's avatar Виталий Кирсанов Committed by Erik de Castro Lopo

Fixed dependencies on win_utf8_io

parent 5d81610e
......@@ -9,9 +9,9 @@ add_subdirectory("libFLAC")
if(BUILD_CXXLIBS)
add_subdirectory("libFLAC++")
endif()
add_subdirectory("share")
add_subdirectory("flac")
add_subdirectory("metaflac")
add_subdirectory("share")
add_subdirectory("utils")
if(WITH_XMMS)
......
......@@ -15,6 +15,9 @@ target_link_libraries(flac
getopt
replaygain_synthesis
utf8)
if(TARGET win_utf8_io)
target_link_libraries(flac win_utf8_io)
endif()
install(TARGETS flac EXPORT targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
......@@ -27,14 +27,14 @@ add_library(FLAC++-static STATIC ${SOURCES})
target_compile_definitions(FLAC++-static PUBLIC FLAC__NO_DLL)
target_include_directories(FLAC++-static INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
"$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC++-static PUBLIC FLAC-static)
add_library(FLAC++ SHARED ${SOURCES})
target_compile_definitions(FLAC++ PRIVATE FLACPP_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
target_include_directories(FLAC++ INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
"$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC++ PRIVATE FLAC)
set_target_properties(FLAC++ PROPERTIES
CXX_VISIBILITY_PRESET hidden
......
......@@ -87,6 +87,9 @@ set(SOURCES
$<$<BOOL:${OGG_FOUND}>:ogg_helper.c>
$<$<BOOL:${OGG_FOUND}>:ogg_mapping.c>
$<$<BOOL:${WIN32}>:windows_unicode_filenames.c>)
if(TARGET FLAC-asm)
list(APPEND SOURCES $<TARGET_OBJECTS:FLAC-asm>)
endif()
include_directories("include")
......@@ -94,14 +97,8 @@ add_library(FLAC-static STATIC ${SOURCES})
target_compile_definitions(FLAC-static PUBLIC FLAC__NO_DLL)
target_include_directories(FLAC-static INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
"$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC-static PUBLIC $<$<BOOL:${HAVE_LROUND}>:m>)
if(TARGET FLAC-asm)
target_link_libraries(FLAC-static PUBLIC FLAC-asm>)
endif()
if(TARGET win_utf8_io)
target_link_libraries(FLAC-static PUBLIC win_utf8_io>)
endif()
if(TARGET Ogg::Ogg-static)
target_link_libraries(FLAC-static PUBLIC Ogg::Ogg-static)
elseif(TARGET Ogg::Ogg)
......@@ -112,14 +109,8 @@ add_library(FLAC SHARED ${SOURCES})
target_compile_definitions(FLAC PRIVATE FLAC_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
target_include_directories(FLAC INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
"$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC PRIVATE $<$<BOOL:${HAVE_LROUND}>:m>)
if(TARGET FLAC-asm)
target_link_libraries(FLAC PUBLIC FLAC-asm>)
endif()
if(TARGET win_utf8_io)
target_link_libraries(FLAC PUBLIC win_utf8_io>)
endif()
if(TARGET Ogg::Ogg)
target_link_libraries(FLAC PUBLIC Ogg::Ogg)
endif()
......
......@@ -12,7 +12,7 @@ else()
add_compile_options(-dOBJ_FORMAT_elf)
endif()
add_library(FLAC-asm STATIC
add_library(FLAC-asm OBJECT
cpu_asm.nasm
fixed_asm.nasm
lpc_asm.nasm)
......@@ -10,6 +10,9 @@ add_executable(metaflac
usage.c
utils.c)
target_link_libraries(metaflac FLAC-static getopt utf8)
if(TARGET win_utf8_io)
target_link_libraries(metaflac win_utf8_io)
endif()
install(TARGETS metaflac EXPORT targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
check_include_file("libintl.h" HAVE_LIBINTL_H)
check_include_file("string.h" HAVE_STRING_H)
find_package(Intl)
add_library(getopt STATIC getopt.c getopt1.c)
if(Intl_FOUND)
target_include_directories(getopt PRIVATE ${Intl_INCLUDE_DIRS})
target_link_libraries(getopt PUBLIC ${Intl_LIBRARIES})
target_compile_definitions(getopt PRIVATE HAVE_LIBINTL_H)
endif()
......@@ -6,6 +6,9 @@ add_library(grabbag STATIC
replaygain.c
seektable.c
snprintf.c)
target_link_libraries(grabbag
target_link_libraries(grabbag PUBLIC
FLAC-static
replaygain_analysis)
if(TARGET win_utf8_io)
target_link_libraries(grabbag PUBLIC win_utf8_io)
endif()
add_executable(flacdiff main.cpp)
target_link_libraries(flacdiff FLAC++-static)
if(TARGET win_utf8_io)
target_link_libraries(flacdiff win_utf8_io)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment