macos tweaks

This commit is contained in:
milek7
2021-01-19 19:03:42 +01:00
parent 5fcd108b3d
commit 809f0c2077
3 changed files with 25 additions and 9 deletions

View File

@@ -163,10 +163,9 @@ auto python_taskqueue::init() -> bool {
else
Py_SetPythonHome("macpython");
#endif
Py_Initialize();
PyEval_InitThreads();
Py_InitializeEx(0);
m_initialized = true;
PyEval_InitThreads();
PyObject *stringiomodule { nullptr };
PyObject *stringioclassname { nullptr };
@@ -213,6 +212,8 @@ auto python_taskqueue::init() -> bool {
if( false == worker.joinable() ) { return false; }
}
m_initialized = true;
return true;
release_and_exit:
@@ -246,7 +247,8 @@ void python_taskqueue::exit() {
// adds specified task along with provided collection of data to the work queue. returns true on success
auto python_taskqueue::insert( task_request const &Task ) -> bool {
if( ( false == Global.python_enabled )
if( !m_initialized
|| ( false == Global.python_enabled )
|| ( Task.renderer.empty() )
|| ( Task.input == nullptr )
|| ( Task.target == 0 ) ) { return false; }

View File

@@ -143,7 +143,9 @@ eu07_application::init( int Argc, char *Argv[] ) {
if( ( result = init_data() ) != 0 ) {
return result;
}
if( Global.python_enabled ) {
m_taskqueue.init();
}
if( ( result = init_modes() ) != 0 ) {
return result;
}
@@ -735,6 +737,7 @@ eu07_application::init_glfw() {
// activate core profile for opengl 3.3 renderer
if( !Global.gfx_usegles ) {
glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE );
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );
glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );
glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 );
}

View File

@@ -35,12 +35,22 @@ jobs:
sudo xcode-select -s /Applications/Xcode_12.3.app
displayName: 'Setup Xcode'
- script: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install glew glfw libpng glm luajit libserialport libsndfile asio pkg-config
cd /tmp
git clone https://github.com/microsoft/vcpkg
cd vcpkg
git remote add milek https://github.com/Milek7/vcpkg
git fetch milek
git checkout c0020eb4
./bootstrap-vcpkg.sh
./vcpkg install glfw3:x64-osx libpng:x64-osx libsndfile:x64-osx asio:x64-osx
git cherry-pick 9b7f342
git cherry-pick f1b4a0e
MACOSX_DEPLOYMENT_TARGET="10.12" ./vcpkg install luajit:x64-osx
displayName: 'Install dependencies'
- script: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_ZMQ=OFF -DWITH_OPENVR=OFF
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-osx -DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DWITH_UART=OFF
cmake --build .
displayName: 'Build'
- task: PublishBuildArtifacts@1
@@ -49,10 +59,10 @@ jobs:
artifactName: binaries_macos
displayName: 'Publish binaries'
- job: macos1015_arm64
- job: macos11_arm64
pool:
vmImage: 'macOS-10.15'
displayName: 'MacOS 10.15 ARM64'
displayName: 'MacOS 11.1 ARM64'
steps:
- script: |
sudo xcode-select -s /Applications/Xcode_12.3.app
@@ -67,6 +77,7 @@ jobs:
./bootstrap-vcpkg.sh
./vcpkg install glfw3:arm64-osx libpng:arm64-osx libsndfile:arm64-osx asio:arm64-osx
git cherry-pick 9b7f342
git cherry-pick ea5d2d7
./vcpkg install luajit:arm64-osx
displayName: 'Install dependencies'
- script: |