1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 20:22:39 +01:00

Fix osx compilation and CI

This commit is contained in:
Elias Steurer 2020-10-31 19:59:46 +01:00
parent 2ca67739ef
commit f188e6eb1c
6 changed files with 30 additions and 10 deletions

View File

@ -55,7 +55,7 @@ build:osx_debug:
- check
script:
- cd Tools
- python build.py -t debug
- python3 build.py -t debug
artifacts:
expire_in: '4 weeks'
paths:
@ -70,7 +70,7 @@ build:osx_release:
- check
script:
- cd Tools
- python build.py -t release
- python3 build.py -t release
artifacts:
expire_in: '4 weeks'
paths:

View File

@ -17,6 +17,15 @@ elseif(APPLE)
set(VCPKG_ARCH "x64-osx")
endif()
# assume built-in pthreads on MacOS https://stackoverflow.com/questions/54587052/cmake-on-mac-could-not-find-threads-missing-threads-found
if(APPLE)
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)
endif()
set(VCPKG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ScreenPlay-vcpkg")
set(VCPKG_INSTALLED_PATH "${VCPKG_PATH}/installed/${VCPKG_ARCH}")
set(QT_TELEMTRY_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/Common/qt-google-analytics/)
@ -48,8 +57,8 @@ execute_process(
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
if(UNIX)
# Fixes QWebEngine linker errors
if(UNIX AND NOT APPLE)
# Fixes QWebEngine linker errors on Ubuntu 20.04
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif()

View File

@ -120,6 +120,9 @@ if(WIN32)
configure_file(${VCPKG_INSTALLED_PATH}/tools/sentry-native/crashpad_handler.exe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
elseif(APPLE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
# cmake-format: off
# Auto ffmpeg download missing for osx
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
# cmake-format: on
endif()

View File

@ -217,16 +217,20 @@ void App::exit()
bool App::loadSteamPlugin()
{
#ifdef Q_OS_MACOS
const QString fileSuffix = ".dylib";
#endif
#ifdef Q_OS_WIN
#ifdef QT_NO_DEBUG
const QString fileSuffix = ".dll";
#else
const QString fileSuffix = "d.dll";
#endif
#else
#endif
#ifdef Q_OS_LINUX
const QString fileSuffix = ".so";
#endif

View File

@ -13,7 +13,7 @@ if(WIN32)
set(headers_plattform src/windowsdesktopproperties.h src/winwindow.h)
elseif(APPLE)
set(src_plattform src/macintegration.cpp src/macwindow.cpp)
set(headers_plattform src/macintegration.h src/macbridge.h src/macwindow.h)
set(headers_plattform src/macintegration.h src/macbridge.h src/macwindow.h src/MacBridge.mm)
elseif(UNIX)
set(src_plattform main.cpp src/linuxwindow.cpp)
set(headers_plattform src/linuxwindow.h)
@ -35,3 +35,7 @@ add_executable(${PROJECT_NAME} ${src} ${headers} ${src_plattform} ${headers_plat
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Core Qt5::WebEngine ScreenPlaySDK)
if(APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa")
endif()

View File

@ -56,14 +56,14 @@ elif platform == "darwin":
cmake_target_triplet = "x64-osx"
print("Executing install_dependencies_linux_mac.sh")
os.system("chmod +x install_dependencies_linux_mac.sh")
os.system("install_dependencies_linux_mac.sh")
os.system("./install_dependencies_linux_mac.sh")
elif platform == "linux":
deploy_executable = "linuxdeployqt"
cmake_prefix_path = "~/Qt/"
cmake_target_triplet = "x64-linux"
print("Executing install_dependencies_linux_mac.sh")
os.system("chmod +x install_dependencies_linux_mac.sh")
os.system("install_dependencies_linux_mac.sh")
os.system("./install_dependencies_linux_mac.sh")
# REMOVE OLD BUILD FOLDER
cwd = os.getcwd()