Skip to content

Commit

Permalink
Merge branch 'main' into node_editor_fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm authored Oct 12, 2024
2 parents 7333501 + 4f380f3 commit cb6e8c9
Show file tree
Hide file tree
Showing 36 changed files with 1,685 additions and 1,149 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: Linux_GCC_9_Python37
os: ubuntu-20.04
- name: Linux_GCC_10_Python37
os: ubuntu-22.04
compiler: gcc
compiler_version: "9"
compiler_version: "10"
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON -DMATERIALX_BUILD_MONOLITHIC=ON

Expand All @@ -37,8 +37,6 @@ jobs:
compiler: gcc
compiler_version: "14"
python: 3.12
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Linux_GCC_CoverageAnalysis
os: ubuntu-24.04
Expand All @@ -48,10 +46,10 @@ jobs:
coverage_analysis: ON
cmake_config: -DMATERIALX_COVERAGE_ANALYSIS=ON -DMATERIALX_BUILD_RENDER=OFF -DMATERIALX_BUILD_PYTHON=OFF

- name: Linux_Clang_10_Python37
os: ubuntu-20.04
- name: Linux_Clang_13_Python37
os: ubuntu-22.04
compiler: clang
compiler_version: "10"
compiler_version: "13"
python: 3.7
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON

Expand All @@ -63,10 +61,10 @@ jobs:
test_render: ON
clang_format: ON

- name: MacOS_Xcode_13_Python39
os: macos-12
- name: MacOS_Xcode_14_Python39
os: macos-13
compiler: xcode
compiler_version: "13.1"
compiler_version: "14.1"
cmake_config: -DMATERIALX_BUILD_SHARED_LIBS=ON
python: 3.9

Expand All @@ -75,6 +73,8 @@ jobs:
compiler: xcode
compiler_version: "14.3"
python: 3.11
static_analysis: ON
cmake_config: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: MacOS_Xcode_15_Python312
os: macos-14
Expand Down Expand Up @@ -127,6 +127,7 @@ jobs:
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install xorg-dev
if [ "${{ matrix.compiler_version }}" != 'None' ]; then
if [ "${{ matrix.compiler }}" = "gcc" ]; then
Expand Down Expand Up @@ -245,10 +246,14 @@ jobs:
working-directory: build

- name: Static Analysis Tests
if: matrix.static_analysis == 'ON' && runner.os == 'Linux'
if: matrix.static_analysis == 'ON'
run: |
sudo apt-get install cppcheck
cppcheck --project=build/compile_commands.json --error-exitcode=1 --suppress=*:*/External/* --suppress=*:*/NanoGUI/*
if [ "${{ runner.os }}" = "Linux" ]; then
sudo apt-get install cppcheck
else
brew install cppcheck
fi
cppcheck --project=build/compile_commands.json --error-exitcode=1 --suppress=normalCheckLevelMaxBranches --suppress=*:*/External/* --suppress=*:*/NanoGUI/*
- name: Initialize Virtual Framebuffer
if: matrix.test_render == 'ON' && runner.os == 'Linux'
Expand Down Expand Up @@ -347,7 +352,7 @@ jobs:

sdist:
name: Python SDist
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'AcademySoftwareFoundation/MaterialX'
outputs:
sdist_filename: ${{ steps.generate.outputs.filename }}
Expand Down Expand Up @@ -383,7 +388,7 @@ jobs:
fail-fast: false
matrix:
python-minor: ['7', '8', '9', '10', '11', '12']
os: ['ubuntu-latest', 'windows-2022', 'macos-13']
os: ['ubuntu-22.04', 'windows-2022', 'macos-13']

steps:
- name: Sync Repository
Expand Down
31 changes: 5 additions & 26 deletions cmake/modules/AppleFrameworkBuild.zsh.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ BUNDLE_IDENTIFIER="org.aswf.materialx"
CODESIGN_ID="@CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY@"
OLD_RC_PATH="${CMAKE_INSTALL_PREFIX}/lib"

function fix_linkage() {
readonly file=${1:?"A file path must be specified."}
readonly prepend="${FRAMEWORK_NAME}.framework/Libraries"
filename=$(basename ${file})
# First, change the install name. This corresponds to LC_ID_DYLIB.
install_name_tool -id "@rpath/${prepend}/${filename}" ${file}

parts=("${(@f)$(otool -l ${file})}")
for line in ${parts}; do
dylib_name=""
[[ $line =~ ' *name @rpath/(.*\.dylib)' ]] && dylib_name=$match[1]
if [ -n "${dylib_name}" ]; then
install_name_tool -change "@rpath/${dylib_name}" "@rpath/${prepend}/${dylib_name}" "${file}"
fi
if [[ $line == *"${OLD_RC_PATH}"* ]]; then
install_name_tool -delete_rpath ${OLD_RC_PATH} ${file}
fi
done

codesign -f -s ${CODESIGN_ID} ${file}
}

# Remove the existing directory if it exists
if [ -d ${FRAMEWORK_DIR} ]; then
echo "Removing existing framework";
Expand All @@ -53,15 +31,17 @@ echo "Creating Framework Directory: ${FRAMEWORK_DIR}"
mkdir -p ${FRAMEWORK_DIR}

if [ "$EMBEDDED_BUILD" = true ];then
FRAMEWORK_RESOURCES_DIR="${FRAMEWORK_DIR}/Resources"
FRAMEWORK_RESOURCES_DIR="${FRAMEWORK_DIR}/Assets"
FRAMEWORK_PLIST_LOCATION="${FRAMEWORK_DIR}/Info.plist"
FRAMEWORK_HEADERS_DIR="${FRAMEWORK_DIR}/Headers"
FRAMEWORK_LIB_PATH=""${FRAMEWORK_DIR}/${FRAMEWORK_NAME}""
FRAMEWORK_LINKER_PATH="@rpath/Frameworks/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"
else
FRAMEWORK_RESOURCES_DIR="${FRAMEWORK_DIR}/Versions/A/Resources/"
FRAMEWORK_PLIST_LOCATION="${FRAMEWORK_DIR}/Versions/A/Resources/Info.plist"
FRAMEWORK_HEADERS_DIR="${FRAMEWORK_DIR}/Versions/A/Headers"
FRAMEWORK_LIB_PATH="${FRAMEWORK_DIR}/Versions/A/${FRAMEWORK_NAME}"
FRAMEWORK_LINKER_PATH="@rpath/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"
fi

echo "Creating Resources Root: ${FRAMEWORK_RESOURCES_DIR}"
Expand Down Expand Up @@ -90,9 +70,8 @@ if [ "$EMBEDDED_BUILD" = false ];then
fi

# Fix the linkage on the primary dylib
fix_linkage "${FRAMEWORK_DIR}/${FRAMEWORK_NAME}"
install_name_tool -id "@rpath/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${FRAMEWORK_DIR}/${FRAMEWORK_NAME}"
install_name_tool -change "@rpath/${FRAMEWORK_NAME}.framework/Libraries/${FRAMEWORK_NAME}" "@rpath/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" "${FRAMEWORK_DIR}/${FRAMEWORK_NAME}"
install_name_tool -id "${FRAMEWORK_LINKER_PATH}" "${FRAMEWORK_DIR}/${FRAMEWORK_NAME}"
install_name_tool -change "@rpath/libMaterialX.@[email protected]" "${FRAMEWORK_LINKER_PATH}" "${FRAMEWORK_DIR}/${FRAMEWORK_NAME}"

# Frameworks require all includes to use the framework name as the prefix for automatic discovery
echo "Modifying headers..."
Expand Down
Loading

0 comments on commit cb6e8c9

Please sign in to comment.