Skip to content

Commit

Permalink
Try another sysroot for compilation on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
tpaviot committed Aug 16, 2022
1 parent 4c88d1a commit 9e25e46
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
10 changes: 1 addition & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ if(NOT DEFINED PYTHONOCC_BUILD_TYPE)
endif(NOT DEFINED PYTHONOCC_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${PYTHONOCC_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE)

message(STATUS " ${CMAKE_CXX_FLAGS}")
set(BUILD_SHARED_LIBS ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

Expand Down Expand Up @@ -120,7 +119,7 @@ message(STATUS "Python library release: ${Python3_LIBRARY_RELEASE}")
########
# SWIG #
########
find_package(SWIG 3.0.11 REQUIRED)
find_package(SWIG 4.0.2 REQUIRED)
include(${SWIG_USE_FILE})
set(SWIG_FILES_PATH src/SWIG_files/wrapper)
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -fvirtual -py3)
Expand Down Expand Up @@ -382,13 +381,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}/src/Addons/Font3d.cpp

swig_add_library(Addons LANGUAGE python SOURCES ${ADDONS_SOURCE_FILES} TYPE MODULE)
swig_link_libraries(Addons ${OCE_MODEL_LIBRARIES} ${OCE_VISUALIZATION_LIBRARIES} Python3::Module)
#if (APPLE)
# set_target_properties(${SWIG_MODULE_Addons_REAL_NAME} PROPERTIES COMPILE_FLAGS ${PYTHON_CFLAGS})
# set_target_properties(${SWIG_MODULE_Addons_REAL_NAME} PROPERTIES LINK_FLAGS ${PYTHON_LDFLAGS})
# swig_link_libraries(Addons ${OPENGL_LIBRARIES})
#else(APPLE)
# swig_link_libraries(Addons ${PYTHON_LIBRARIES})
#endif(APPLE)

################
# Installation #
Expand Down
10 changes: 5 additions & 5 deletions ci/conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ninja
ninja install

# fix rpaths
if [ $(uname) == Darwin ]; then
for lib in $(ls $SP_DIR/OCC/_*.so); do
install_name_tool -rpath $PREFIX/lib @loader_path/../../../ $lib
done
fi
#if [ $(uname) == Darwin ]; then
# for lib in $(ls $SP_DIR/OCC/_*.so); do
# install_name_tool -rpath $PREFIX/lib @loader_path/../../../ $lib
# done
#fi
5 changes: 4 additions & 1 deletion ci/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ build:

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ cdt('libx11-devel') }} # [linux]
- {{ cdt('xorg-x11-proto-devel') }} # [linux]
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('libxi-devel') }} # [linux]
- ninja
- cmake
- swig >=3.0.11
- swig >=4.0.2

host:
- python {{ python }}
Expand All @@ -38,6 +39,8 @@ test:
imports:
- OCC
- OCC.Core.BRepPrimAPI
- OCC.Core.MeshDS
- OCC.Core.Tesselator
requires:
- pyqt >=5
- mypy
Expand Down
18 changes: 9 additions & 9 deletions conda-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
displayName: 'Install OpenGL headers'
# macOS ownership workaround and fix osx sdk
- ${{ if contains(parameters.vmImage, 'macOS') }}:
- bash: |
sudo chown -R $USER $CONDA && \
curl -o MacOSX10.9.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz && \
tar xf MacOSX10.9.sdk.tar.xz && \
sudo mkdir -p /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs && \
sudo mv -v MacOSX10.9.sdk /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ && \
ls /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
displayName: 'MacOS ownership workaround and installation of MacOSX10.9 sdk'
# - ${{ if contains(parameters.vmImage, 'macOS') }}:
# - bash: |
# sudo chown -R $USER $CONDA && \
# curl -o MacOSX10.9.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz && \
# tar xf MacOSX10.9.sdk.tar.xz && \
# sudo mkdir -p /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs && \
# sudo mv -v MacOSX10.9.sdk /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ && \
# ls /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
# displayName: 'MacOS ownership workaround and installation of MacOSX10.9 sdk'

- bash: |
conda config --set always_yes yes --set changeps1 no && \
Expand Down

0 comments on commit 9e25e46

Please sign in to comment.