Cleanup CMakeLists.txt a bit and add coverage builds (#493)
Add TSMUXER_COVERAGE which will result in building binaries with coverage information when set to true. Move MSVC flag utf-8 from tsMuxerGUI to the general CMakeLists.txt as there is no reason not to enable it globally. Replace NOT MSVC with checking if the build is for Linux : the effect is the same, but the intent is clearer. Restructure the platform-specific conditions for building tsMuxerGUI. Bind the XP build to windows-2019 hosts as windows-2022 includes Visual Studio 2022 which dropped XP support. Don't install zlib via homebrew in macos in order to avoid conflicts with the system-provided one.master
parent
c483756b42
commit
88316ec3e9
|
@ -13,7 +13,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-winxp-gui:
|
build-winxp-gui:
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-2019
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
|
|
|
@ -23,18 +23,39 @@ else()
|
||||||
endif()
|
endif()
|
||||||
add_definitions("-DTSMUXER_VERSION=\"${TSMUXER_VERSION}\"")
|
add_definitions("-DTSMUXER_VERSION=\"${TSMUXER_VERSION}\"")
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
mark_as_advanced(CLEAR
|
mark_as_advanced(CLEAR
|
||||||
CMAKE_INSTALL_BINDIR
|
CMAKE_INSTALL_BINDIR
|
||||||
CMAKE_INSTALL_DATADIR
|
CMAKE_INSTALL_DATADIR
|
||||||
)
|
)
|
||||||
else(NOT MSVC)
|
else()
|
||||||
set(CMAKE_INSTALL_BINDIR bin)
|
set(CMAKE_INSTALL_BINDIR bin)
|
||||||
endif(NOT MSVC)
|
endif()
|
||||||
|
|
||||||
add_subdirectory (libmediation)
|
if(MSVC)
|
||||||
add_subdirectory (tsMuxer)
|
add_compile_options("/utf-8")
|
||||||
if(TSMUXER_GUI)
|
endif()
|
||||||
add_subdirectory (tsMuxerGUI)
|
|
||||||
|
if(WIN32)
|
||||||
|
add_definitions(-DUNICODE -D_UNICODE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(TSMUXER_COVERAGE FALSE CACHE BOOL "Enable collecting coverage information")
|
||||||
|
if(${TSMUXER_COVERAGE})
|
||||||
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||||
|
add_compile_options("--coverage")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||||
|
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||||
|
add_compile_options("-fprofile-instr-generate" "-fcoverage-mapping")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-instr-generate")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Coverage not supported for compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(libmediation)
|
||||||
|
add_subdirectory(tsMuxer)
|
||||||
|
if(TSMUXER_GUI)
|
||||||
|
add_subdirectory(tsMuxerGUI)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -7,7 +7,6 @@ export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||||
|
|
||||||
brew install pkg-config
|
brew install pkg-config
|
||||||
brew install freetype
|
brew install freetype
|
||||||
brew install zlib
|
|
||||||
|
|
||||||
builddir=$PWD
|
builddir=$PWD
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ add_library(mediation STATIC
|
||||||
)
|
)
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
target_compile_definitions(mediation PRIVATE "-DUNICODE")
|
|
||||||
target_sources(mediation PRIVATE fs/osdep/file_win32.cpp fs/osdep/directory_win32.cpp)
|
target_sources(mediation PRIVATE fs/osdep/file_win32.cpp fs/osdep/directory_win32.cpp)
|
||||||
ELSE()
|
ELSE()
|
||||||
target_compile_definitions(mediation PRIVATE "-D_FILE_OFFSET_BITS=64")
|
target_compile_definitions(mediation PRIVATE "-D_FILE_OFFSET_BITS=64")
|
||||||
|
|
|
@ -115,7 +115,6 @@ target_link_libraries(tsmuxer mediation ${THREADSLIB} ${ZLIB_LIBRARIES})
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_sources(tsmuxer PRIVATE osdep/textSubtitlesRenderWin32.cpp)
|
target_sources(tsmuxer PRIVATE osdep/textSubtitlesRenderWin32.cpp)
|
||||||
target_link_libraries(tsmuxer gdiplus)
|
target_link_libraries(tsmuxer gdiplus)
|
||||||
target_compile_definitions(tsmuxer PRIVATE "-DUNICODE")
|
|
||||||
else()
|
else()
|
||||||
target_sources(tsmuxer PRIVATE osdep/textSubtitlesRenderFT.cpp)
|
target_sources(tsmuxer PRIVATE osdep/textSubtitlesRenderFT.cpp)
|
||||||
# on osxcross use the static freetype library explicitly
|
# on osxcross use the static freetype library explicitly
|
||||||
|
|
|
@ -57,33 +57,22 @@ set(tsmuxer_gui_sources
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${lang_qrc}
|
${CMAKE_CURRENT_BINARY_DIR}/${lang_qrc}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
if (WIN32)
|
||||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
add_executable(tsMuxerGUI WIN32 ${tsmuxer_gui_sources} icon.rc)
|
||||||
|
elseif (APPLE)
|
||||||
set(GUI_OPTIONS "")
|
set(MACOSX_BUNDLE_ICON_FILE tsMuxerGUI.icns)
|
||||||
if(WIN32)
|
set_source_files_properties(tsMuxerGUI.icns PROPERTIES
|
||||||
set(GUI_OPTIONS WIN32)
|
MACOSX_PACKAGE_LOCATION "Resources")
|
||||||
elseif(APPLE)
|
add_executable(tsMuxerGUI MACOSX_BUNDLE ${tsmuxer_gui_sources} tsMuxerGUI.icns)
|
||||||
set(GUI_OPTIONS MACOSX_BUNDLE)
|
# UNIX must be last here, as it's going to be true for APPLE and CYGWIN as well,
|
||||||
endif()
|
# but we want those to be handled by the code above.
|
||||||
|
elseif (UNIX)
|
||||||
add_executable(tsMuxerGUI ${GUI_OPTIONS} ${tsmuxer_gui_sources})
|
add_executable(tsMuxerGUI ${tsmuxer_gui_sources})
|
||||||
target_link_libraries(tsMuxerGUI ${tsmuxer_gui_libs})
|
|
||||||
|
|
||||||
if(NOT MSVC)
|
|
||||||
install(TARGETS tsMuxerGUI DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS tsMuxerGUI DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install(FILES tsMuxerGUI.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
install(FILES tsMuxerGUI.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||||
install(FILES images/icon.png
|
install(FILES images/icon.png
|
||||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/
|
||||||
RENAME tsMuxerGUI.png)
|
RENAME tsMuxerGUI.png)
|
||||||
endif(NOT MSVC)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
target_sources(tsMuxerGUI PRIVATE icon.rc)
|
|
||||||
elseif (APPLE)
|
|
||||||
set(MACOSX_BUNDLE_ICON_FILE tsMuxerGUI.icns)
|
|
||||||
set_source_files_properties(tsMuxerGUI.icns PROPERTIES
|
|
||||||
MACOSX_PACKAGE_LOCATION "Resources")
|
|
||||||
set_target_properties(tsMuxerGUI PROPERTIES MACOSX_BUNDLE TRUE)
|
|
||||||
target_sources(tsMuxerGUI PRIVATE tsMuxerGUI.icns)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(tsMuxerGUI ${tsmuxer_gui_libs})
|
||||||
|
|
|
@ -23,6 +23,9 @@ TRANSLATIONS = translations/tsmuxergui_en.ts translations/tsmuxergui_ru.ts trans
|
||||||
win32 {
|
win32 {
|
||||||
RC_FILE += icon.rc
|
RC_FILE += icon.rc
|
||||||
}
|
}
|
||||||
|
win32-msvc* {
|
||||||
|
QMAKE_CXXFLAGS += /utf-8
|
||||||
|
}
|
||||||
|
|
||||||
version_num = 2.6.16
|
version_num = 2.6.16
|
||||||
tsmuxer_release = 0
|
tsmuxer_release = 0
|
||||||
|
|
Loading…
Reference in New Issue