1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02: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 - check
script: script:
- cd Tools - cd Tools
- python build.py -t debug - python3 build.py -t debug
artifacts: artifacts:
expire_in: '4 weeks' expire_in: '4 weeks'
paths: paths:
@ -70,7 +70,7 @@ build:osx_release:
- check - check
script: script:
- cd Tools - cd Tools
- python build.py -t release - python3 build.py -t release
artifacts: artifacts:
expire_in: '4 weeks' expire_in: '4 weeks'
paths: paths:

View File

@ -17,6 +17,15 @@ elseif(APPLE)
set(VCPKG_ARCH "x64-osx") set(VCPKG_ARCH "x64-osx")
endif() 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_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ScreenPlay-vcpkg")
set(VCPKG_INSTALLED_PATH "${VCPKG_PATH}/installed/${VCPKG_ARCH}") set(VCPKG_INSTALLED_PATH "${VCPKG_PATH}/installed/${VCPKG_ARCH}")
set(QT_TELEMTRY_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/Common/qt-google-analytics/) 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}") add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
if(UNIX) if(UNIX AND NOT APPLE)
# Fixes QWebEngine linker errors # Fixes QWebEngine linker errors on Ubuntu 20.04
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
endif() 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) configure_file(${VCPKG_INSTALLED_PATH}/tools/sentry-native/crashpad_handler.exe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
elseif(APPLE) elseif(APPLE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg ${CMAKE_BINARY_DIR}/bin/ COPYONLY) # cmake-format: off
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe ${CMAKE_BINARY_DIR}/bin/ COPYONLY) # 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() endif()

View File

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

View File

@ -13,7 +13,7 @@ if(WIN32)
set(headers_plattform src/windowsdesktopproperties.h src/winwindow.h) set(headers_plattform src/windowsdesktopproperties.h src/winwindow.h)
elseif(APPLE) elseif(APPLE)
set(src_plattform src/macintegration.cpp src/macwindow.cpp) 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) elseif(UNIX)
set(src_plattform main.cpp src/linuxwindow.cpp) set(src_plattform main.cpp src/linuxwindow.cpp)
set(headers_plattform src/linuxwindow.h) 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) 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) 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" cmake_target_triplet = "x64-osx"
print("Executing install_dependencies_linux_mac.sh") print("Executing install_dependencies_linux_mac.sh")
os.system("chmod +x 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": elif platform == "linux":
deploy_executable = "linuxdeployqt" deploy_executable = "linuxdeployqt"
cmake_prefix_path = "~/Qt/" cmake_prefix_path = "~/Qt/"
cmake_target_triplet = "x64-linux" cmake_target_triplet = "x64-linux"
print("Executing install_dependencies_linux_mac.sh") print("Executing install_dependencies_linux_mac.sh")
os.system("chmod +x 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 # REMOVE OLD BUILD FOLDER
cwd = os.getcwd() cwd = os.getcwd()