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") ...@@ -9,9 +9,9 @@ add_subdirectory("libFLAC")
if(BUILD_CXXLIBS) if(BUILD_CXXLIBS)
add_subdirectory("libFLAC++") add_subdirectory("libFLAC++")
endif() endif()
add_subdirectory("share")
add_subdirectory("flac") add_subdirectory("flac")
add_subdirectory("metaflac") add_subdirectory("metaflac")
add_subdirectory("share")
add_subdirectory("utils") add_subdirectory("utils")
if(WITH_XMMS) if(WITH_XMMS)
......
...@@ -15,6 +15,9 @@ target_link_libraries(flac ...@@ -15,6 +15,9 @@ target_link_libraries(flac
getopt getopt
replaygain_synthesis replaygain_synthesis
utf8) utf8)
if(TARGET win_utf8_io)
target_link_libraries(flac win_utf8_io)
endif()
install(TARGETS flac EXPORT targets install(TARGETS flac EXPORT targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
...@@ -27,14 +27,14 @@ add_library(FLAC++-static STATIC ${SOURCES}) ...@@ -27,14 +27,14 @@ add_library(FLAC++-static STATIC ${SOURCES})
target_compile_definitions(FLAC++-static PUBLIC FLAC__NO_DLL) target_compile_definitions(FLAC++-static PUBLIC FLAC__NO_DLL)
target_include_directories(FLAC++-static INTERFACE target_include_directories(FLAC++-static INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>") "$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC++-static PUBLIC FLAC-static) target_link_libraries(FLAC++-static PUBLIC FLAC-static)
add_library(FLAC++ SHARED ${SOURCES}) add_library(FLAC++ SHARED ${SOURCES})
target_compile_definitions(FLAC++ PRIVATE FLACPP_API_EXPORTS FLAC__USE_VISIBILITY_ATTR) target_compile_definitions(FLAC++ PRIVATE FLACPP_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
target_include_directories(FLAC++ INTERFACE target_include_directories(FLAC++ INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>") "$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC++ PRIVATE FLAC) target_link_libraries(FLAC++ PRIVATE FLAC)
set_target_properties(FLAC++ PROPERTIES set_target_properties(FLAC++ PROPERTIES
CXX_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden
......
...@@ -87,6 +87,9 @@ set(SOURCES ...@@ -87,6 +87,9 @@ set(SOURCES
$<$<BOOL:${OGG_FOUND}>:ogg_helper.c> $<$<BOOL:${OGG_FOUND}>:ogg_helper.c>
$<$<BOOL:${OGG_FOUND}>:ogg_mapping.c> $<$<BOOL:${OGG_FOUND}>:ogg_mapping.c>
$<$<BOOL:${WIN32}>:windows_unicode_filenames.c>) $<$<BOOL:${WIN32}>:windows_unicode_filenames.c>)
if(TARGET FLAC-asm)
list(APPEND SOURCES $<TARGET_OBJECTS:FLAC-asm>)
endif()
include_directories("include") include_directories("include")
...@@ -94,14 +97,8 @@ add_library(FLAC-static STATIC ${SOURCES}) ...@@ -94,14 +97,8 @@ add_library(FLAC-static STATIC ${SOURCES})
target_compile_definitions(FLAC-static PUBLIC FLAC__NO_DLL) target_compile_definitions(FLAC-static PUBLIC FLAC__NO_DLL)
target_include_directories(FLAC-static INTERFACE target_include_directories(FLAC-static INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" "$<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>) 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) if(TARGET Ogg::Ogg-static)
target_link_libraries(FLAC-static PUBLIC Ogg::Ogg-static) target_link_libraries(FLAC-static PUBLIC Ogg::Ogg-static)
elseif(TARGET Ogg::Ogg) elseif(TARGET Ogg::Ogg)
...@@ -112,14 +109,8 @@ add_library(FLAC SHARED ${SOURCES}) ...@@ -112,14 +109,8 @@ add_library(FLAC SHARED ${SOURCES})
target_compile_definitions(FLAC PRIVATE FLAC_API_EXPORTS FLAC__USE_VISIBILITY_ATTR) target_compile_definitions(FLAC PRIVATE FLAC_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
target_include_directories(FLAC INTERFACE target_include_directories(FLAC INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>") "$<INSTALL_INTERFACE:include>")
target_link_libraries(FLAC PRIVATE $<$<BOOL:${HAVE_LROUND}>:m>) 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) if(TARGET Ogg::Ogg)
target_link_libraries(FLAC PUBLIC Ogg::Ogg) target_link_libraries(FLAC PUBLIC Ogg::Ogg)
endif() endif()
......
...@@ -12,7 +12,7 @@ else() ...@@ -12,7 +12,7 @@ else()
add_compile_options(-dOBJ_FORMAT_elf) add_compile_options(-dOBJ_FORMAT_elf)
endif() endif()
add_library(FLAC-asm STATIC add_library(FLAC-asm OBJECT
cpu_asm.nasm cpu_asm.nasm
fixed_asm.nasm fixed_asm.nasm
lpc_asm.nasm) lpc_asm.nasm)
...@@ -10,6 +10,9 @@ add_executable(metaflac ...@@ -10,6 +10,9 @@ add_executable(metaflac
usage.c usage.c
utils.c) utils.c)
target_link_libraries(metaflac FLAC-static getopt utf8) 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 install(TARGETS metaflac EXPORT targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
check_include_file("libintl.h" HAVE_LIBINTL_H)
check_include_file("string.h" HAVE_STRING_H) check_include_file("string.h" HAVE_STRING_H)
find_package(Intl)
add_library(getopt STATIC getopt.c getopt1.c) 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 ...@@ -6,6 +6,9 @@ add_library(grabbag STATIC
replaygain.c replaygain.c
seektable.c seektable.c
snprintf.c) snprintf.c)
target_link_libraries(grabbag target_link_libraries(grabbag PUBLIC
FLAC-static FLAC-static
replaygain_analysis) replaygain_analysis)
if(TARGET win_utf8_io)
target_link_libraries(grabbag PUBLIC win_utf8_io)
endif()
add_executable(flacdiff main.cpp) add_executable(flacdiff main.cpp)
target_link_libraries(flacdiff FLAC++-static) 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