Skip to content

Commit

Permalink
Faster windows minimal compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Feb 25, 2024
1 parent 4f936cb commit 40c6567
Showing 1 changed file with 49 additions and 43 deletions.
92 changes: 49 additions & 43 deletions bin/compile_liblcms2_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,60 +32,66 @@ if [[ $KERNEL != *Msys* ]]; then
exit 1
fi

if [[ -z $TLRENDER_RAW ]]; then
export TLRENDER_RAW=ON
fi


MRV2_ROOT=$PWD
SUPERBUILD=$PWD/$BUILD_DIR/tlRender/etc/SuperBuild
INSTALLDIR=$PWD/$BUILD_DIR/install

if [[ ! -e $INSTALLDIR/lib/liblcms2.lib ]]; then
if [[ $TLRENDER_RAW == ON || $TLRENDER_RAW == 1 ]]; then
if [[ ! -e $INSTALLDIR/lib/liblcms2.lib ]]; then

#
# Install development tools
#
pacman -Sy --noconfirm
#
# Install development tools
#
pacman -Sy --noconfirm

pacman -Sy binutils --noconfirm
pacman -Sy binutils --noconfirm

#
# Clone the repository
#
mkdir -p $SUPERBUILD
cd $SUPERBUILD
if [[ ! -d LCMS2 ]]; then
run_cmd git clone --depth 1 --branch $LCMS_BRANCH https://github.com/mm2/Little-CMS.git LCMS2 2> /dev/null
fi

#
# Run configure
#
cd LCMS2
#
# Clone the repository
#
mkdir -p $SUPERBUILD
cd $SUPERBUILD
if [[ ! -d LCMS2 ]]; then
run_cmd git clone --depth 1 --branch $LCMS_BRANCH https://github.com/mm2/Little-CMS.git LCMS2 2> /dev/null
fi

export CC=cl
export CXX=cl
export LD=link
#
# Run configure
#
cd LCMS2

export CC=cl
export CXX=cl
export LD=link

#
# Remove some cl.exe compile warnings
#
sed -i -e 's#-fvisibility=hidden##' ./configure
sed -i -e 's#CFLAGS="-g"#CFLAGS=""#' ./configure
sed -i -e 's#CXXFLAGS="-g"#CXXFLAGS=""#' ./configure
run_cmd ./configure --build=mingw64 --enable-shared --disable-static --prefix=$INSTALLDIR
#
# Remove some cl.exe compile warnings
#
sed -i -e 's#-fvisibility=hidden##' ./configure
sed -i -e 's#CFLAGS="-g"#CFLAGS=""#' ./configure
sed -i -e 's#CXXFLAGS="-g"#CXXFLAGS=""#' ./configure
run_cmd ./configure --build=mingw64 --enable-shared --disable-static --prefix=$INSTALLDIR

#
# Compile and install the library
#
make -j ${CPU_CORES} install
#
# Compile and install the library
#
make -j ${CPU_CORES} install

echo "Compiled result:"
echo
ls $INSTALLDIR/lib/*lcms2*
echo
echo "Compiled result:"
echo
ls $INSTALLDIR/lib/*lcms2*
echo

run_cmd mv $INSTALLDIR/lib/lcms2.dll.lib $INSTALLDIR/lib/liblcms2.lib
run_cmd mv $INSTALLDIR/lib/lcms2.dll.lib $INSTALLDIR/lib/liblcms2.lib

cd $MRV2_ROOT
else
echo "liblcms2 already installed."
cd $MRV2_ROOT
else
echo "liblcms2 already installed."
fi
fi

0 comments on commit 40c6567

Please sign in to comment.