From 1cb968a7d45eea5f45451981c32df79e5b798739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9A=D0=B8?= =?UTF-8?q?=D1=80=D1=81=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Fri, 26 Apr 2019 23:38:10 +0300 Subject: [PATCH] Fixed dependencies on win_utf8_io --- src/CMakeLists.txt | 2 +- src/flac/CMakeLists.txt | 3 +++ src/libFLAC++/CMakeLists.txt | 4 ++-- src/libFLAC/CMakeLists.txt | 19 +++++-------------- src/libFLAC/ia32/CMakeLists.txt | 2 +- src/metaflac/CMakeLists.txt | 3 +++ src/share/getopt/CMakeLists.txt | 9 ++++++++- src/share/grabbag/CMakeLists.txt | 5 ++++- src/utils/flacdiff/CMakeLists.txt | 3 +++ 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index da556d89..ba7a439e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/flac/CMakeLists.txt b/src/flac/CMakeLists.txt index 240209d6..c347c9a4 100644 --- a/src/flac/CMakeLists.txt +++ b/src/flac/CMakeLists.txt @@ -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}") diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt index 71c9629b..35d145c4 100644 --- a/src/libFLAC++/CMakeLists.txt +++ b/src/libFLAC++/CMakeLists.txt @@ -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 "$" - "$") + "$") 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 "$" - "$") + "$") target_link_libraries(FLAC++ PRIVATE FLAC) set_target_properties(FLAC++ PROPERTIES CXX_VISIBILITY_PRESET hidden diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt index b6d59ae3..16afbe73 100644 --- a/src/libFLAC/CMakeLists.txt +++ b/src/libFLAC/CMakeLists.txt @@ -87,6 +87,9 @@ set(SOURCES $<$:ogg_helper.c> $<$:ogg_mapping.c> $<$:windows_unicode_filenames.c>) +if(TARGET FLAC-asm) + list(APPEND SOURCES $) +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 "$" - "$") + "$") target_link_libraries(FLAC-static PUBLIC $<$: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 "$" - "$") + "$") target_link_libraries(FLAC PRIVATE $<$: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() diff --git a/src/libFLAC/ia32/CMakeLists.txt b/src/libFLAC/ia32/CMakeLists.txt index 94357064..88dc69c8 100644 --- a/src/libFLAC/ia32/CMakeLists.txt +++ b/src/libFLAC/ia32/CMakeLists.txt @@ -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) diff --git a/src/metaflac/CMakeLists.txt b/src/metaflac/CMakeLists.txt index 1895e9e0..93f1ec6e 100644 --- a/src/metaflac/CMakeLists.txt +++ b/src/metaflac/CMakeLists.txt @@ -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}") diff --git a/src/share/getopt/CMakeLists.txt b/src/share/getopt/CMakeLists.txt index 1e5f5162..83b530e5 100644 --- a/src/share/getopt/CMakeLists.txt +++ b/src/share/getopt/CMakeLists.txt @@ -1,4 +1,11 @@ -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() diff --git a/src/share/grabbag/CMakeLists.txt b/src/share/grabbag/CMakeLists.txt index a7ab1662..8332fb49 100644 --- a/src/share/grabbag/CMakeLists.txt +++ b/src/share/grabbag/CMakeLists.txt @@ -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() diff --git a/src/utils/flacdiff/CMakeLists.txt b/src/utils/flacdiff/CMakeLists.txt index 7f1421ec..f212b0ea 100644 --- a/src/utils/flacdiff/CMakeLists.txt +++ b/src/utils/flacdiff/CMakeLists.txt @@ -1,2 +1,5 @@ add_executable(flacdiff main.cpp) target_link_libraries(flacdiff FLAC++-static) +if(TARGET win_utf8_io) + target_link_libraries(flacdiff win_utf8_io) +endif()