Skip to content

Commit

Permalink
Terminal: Improved build-tui.sh
Browse files Browse the repository at this point in the history
Build the_Foundation first since it's needed by SEALCurses, and then make sure Lagrange uses the same static the_Foundation that was just built.

Abort the script if a build fails.
  • Loading branch information
skyjake committed May 6, 2022
1 parent ccf4ed2 commit c1c1f60
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Depends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool")
include (ExternalProject)
set (_dependsToBuild)

if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt)
if (DEFINED the_Foundation_DIR OR
NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt)
set (INSTALL_THE_FOUNDATION YES)
find_package (the_Foundation 1.4.0 REQUIRED)
else ()
Expand Down
29 changes: 22 additions & 7 deletions build-tui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# linked to clagrange instead of SDL.
#
# When not using a source tarball, you can get SEALCurses from:
# https://git.skyjake.fi/skyjake/sealcurses.git
# https://git.skyjake.fi/skyjake/sealcurses.git
#
# All command line arguments given to this script are passed to CMake
# All command line arguments given to this script are passed to CMake
# for configuring the build. However, do not set CMAKE_INSTALL_PREFIX,
# because that would interfere with the SEALCurses build.
#
Expand All @@ -31,16 +31,30 @@ fi
mkdir build-tui
cd build-tui

BUILD_DIR=`pwd`

mkdir build-tfdn
cd build-tfdn

cmake ../../lib/the_Foundation -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DTFDN_STATIC_LIBRARY=YES \
-DTFDN_ENABLE_TESTS=NO \
-DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" $*
cmake --build . || exit 1
cmake --install .
cd ..

mkdir build-sealcurses
cd build-sealcurses

cmake ../../lib/sealcurses -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_SHARED=NO \
-DCMAKE_INSTALL_PREFIX="`pwd`/.." $*
cmake --build .
-Dthe_Foundation_DIR="${BUILD_DIR}/lib/cmake/the_Foundation" \
-DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" $*
cmake --build . || exit 1
cmake --install .

cd ..
export PKG_CONFIG_PATH="`pwd`/lib/pkgconfig":${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig":${PKG_CONFIG_PATH}
cmake .. \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
Expand All @@ -51,13 +65,14 @@ cmake .. \
-DENABLE_HARFBUZZ=NO \
-DENABLE_POPUP_MENUS=NO \
-DENABLE_IDLE_SLEEP=NO \
-Dthe_Foundation_DIR="${BUILD_DIR}/lib/cmake/the_Foundation" \
$*
cmake --build .
cmake --build . || exit 1

echo "-----"
echo "clagrange and resources.lgr can be found in 'build-tui'."
read -p "Do you want to install them to ${INSTALL_PREFIX}? [yN] " CONFIRMED
if [ "${CONFIRMED}" == "y" ]; then
if [ "${CONFIRMED}" = "y" ]; then
cmake --install .
exit
fi

0 comments on commit c1c1f60

Please sign in to comment.