Skip to content

Commit

Permalink
Merge pull request #1 from yaynstuff:main
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-linden committed Mar 14, 2024
2 parents df7544d + 2f9b1ed commit c5605a7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
3 changes: 2 additions & 1 deletion autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>license</key>
<string>OpenEXR</string>
<key>license_file</key>
<string>LICENSES/openexr.txt</string>
<string>LICENSES/OpenEXR.txt</string>
<key>name</key>
<string>openexr</string>
<key>platforms</key>
Expand Down Expand Up @@ -40,6 +40,7 @@
</map>
<key>manifest</key>
<array>
<string>LICENSES/OpenEXR.txt</string>
<string>include</string>
<string>lib</string>
</array>
Expand Down
46 changes: 20 additions & 26 deletions build-cmd.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,34 @@ fi

top="$(pwd)"
stage="$(pwd)/stage"
srcdir="$top/openexr"
builddir="$top/build"

echo $top
echo $stage

# load autobuild provided shell functions and variables
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"
mkdir -p "$stage/include" "$stage/lib/release" "$builddir"

# remove_cxxstd
source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions"

build=${AUTOBUILD_BUILD_ID:=0}
version=$(cat VERSION.txt)
echo "${version}.${build}" > "${stage}/VERSION.txt"

mkdir -p "$stage/lib/release"

srcdir="$top/openexr"
builddir="$top/build"

mkdir -p $builddir
mkdir -p $stage
# load autobuild provided shell functions and variables
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"

pushd $builddir

case "$AUTOBUILD_PLATFORM" in
windows*)
cmake $(cygpath -w "$srcdir") -DCMAKE_INSTALL_PREFIX=$(cygpath -w "$top/release")
cmake ../openexr -DCMAKE_INSTALL_PREFIX=../release
cmake --build . --target install --config Release -j
cp -v ../release/lib/*.lib "$stage/lib/release/"
cp -v ../release/bin/*.dll "$stage/lib/release/"
cp -rv ../release/bin/*.dll "$stage/lib/release/"
;;
darwin*)
cmake $srcdir --install-prefix "$top/release" -DOPENEXR_FORCE_INTERNAL_IMATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake ../openexr --install-prefix "$top/release" -DOPENEXR_FORCE_INTERNAL_IMATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --build . --target install --config Release -j

cp -v "$top"/release/lib/*.a "$stage/lib/release/"
Expand All @@ -63,19 +58,18 @@ darwin*)
echo "checking built architectures in libOpenEXR-3_2.a: '$built_archs'. expected 'x86_64 arm64'"
test 'x86_64 arm64' = "$built_archs"
;;
linux64*)
cmake $srcdir --install-prefix "$top/release" -DOPENEXR_FORCE_INTERNAL_IMATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF
cmake --build . --target install --config Release -j

cp -v "$top"/release/lib/*.a "$stage/lib/release/"
linux64)
cmake "../openexr" --install-prefix "$top/release" -DOPENEXR_LIB_SUFFIX= -DBUILD_SHARED_LIBS=OFF
cmake --build . -j$(nproc) --target install --config Release
cp -a $top/release/lib/{libIex.a,libIlmThread.a,libOpenEXR.a,libOpenEXRCore.a,libOpenEXRUtil.a} "$stage/lib/release/"
;;

esac

cp -rv "$top/release/include" "$stage"
cp -rv ../release/include/OpenEXR "$stage/include/OpenEXR"
cp -rv ../release/include/Imath "$stage/include/Imath"

popd

mkdir -p "$stage/LICENSES"
cp "$top/LICENSE" "$stage/LICENSES/openexr.txt"
cp -v $top/VERSION.txt $stage/VERSION.txt

cp "LICENSE" "$stage/LICENSES/OpenEXR.txt"

0 comments on commit c5605a7

Please sign in to comment.