Skip to content

Commit

Permalink
Fix build scripts.
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Ismailov <tama.rilla@protonmail.com>
  • Loading branch information
alexismailov2 committed Apr 25, 2024
1 parent 4cd48c2 commit 8b31c56
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 52 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ jobs:
./build.sh --tool=smake --tools --examples --ssl=no
./tools/xutils
- name: Build with CMAKE (SSL)
run: |
./build.sh --tool=cmake --tools --examples
./tools/build/xutils
- name: Build with CMAKE (no SSL)
run: |
./build.sh --tool=cmake --tools --examples --ssl=no
./tools/build/xutils
# - name: Build with CMAKE (SSL)
# run: |
# ./build.sh --tool=cmake --tools --examples
# ./tools/build/xutils
#
# - name: Build with CMAKE (no SSL)
# run: |
# ./build.sh --tool=cmake --tools --examples --ssl=no
# ./tools/build/xutils

- name: Build with Makefile (SSL)
run: |
Expand Down
89 changes: 46 additions & 43 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,33 +83,33 @@ update_cpu_count() {
fi
}

#build_tools() {
# [ "$TOOLS_DONE" -eq 1 ] && return
# cd $PROJ_PATH/tools
#
build_tools() {
[ "$TOOLS_DONE" -eq 1 ] && return
cd $PROJ_PATH/tools

# if [[ $MAKE_TOOL == "cmake" ]]; then
# cmake -Bbuild -DCMAKE_INSTALL_PREFIX=./libxutils && cmake --build build --target install
# cmake -Bbuild #mkdir -p build && cd build && cmake ..
# TOOL_PATH=$PROJ_PATH/tools/build
# fi
#
# cmake --build build --target install
# #make -j $CPU_COUNT
# cd $PROJ_PATH
# TOOLS_DONE=1
#}

#build_examples() {
# [ "$EXAMPLES_DONE" -eq 1 ] && return
# cd $PROJ_PATH/examples
#

make -j $CPU_COUNT
cd $PROJ_PATH
TOOLS_DONE=1
}

build_examples() {
[ "$EXAMPLES_DONE" -eq 1 ] && return
cd $PROJ_PATH/examples

# if [[ $MAKE_TOOL == "cmake" ]]; then
# mkdir -p build && cd build && cmake ..
# fi
#
# make -j $CPU_COUNT
# cd $PROJ_PATH
# EXAMPLES_DONE=1
#}

make -j $CPU_COUNT
cd $PROJ_PATH
EXAMPLES_DONE=1
}

build_library() {
cd $PROJ_PATH/misc
Expand All @@ -121,8 +121,6 @@ build_library() {
LIB_PATH=$PROJ_PATH
elif [[ $MAKE_TOOL == "cmake" ]]; then
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=./install && cmake --build build --target install
#mkdir -p build && cd build
#cmake .. && make -j $CPU_COUNT
LIB_PATH=$PROJ_PATH/build
elif [[ $MAKE_TOOL == "smake" ]]; then
smake . && make -j $CPU_COUNT
Expand All @@ -136,18 +134,18 @@ build_library() {
cd $PROJ_PATH
}

#install_tools() {
# build_tools
# cd $TOOL_PATH
# sudo make install
# cd $PROJ_PATH
#}
install_tools() {
build_tools
cd $TOOL_PATH
sudo make install
cd $PROJ_PATH
}

#install_library() {
# cd $LIB_PATH
# sudo make install
# cd $PROJ_PATH
#}
install_library() {
cd $LIB_PATH
sudo make install
cd $PROJ_PATH
}

if [[ $USE_SSL == "yes" ]]; then
echo "Checking OpenSSL libraries."
Expand All @@ -173,18 +171,23 @@ clean_project
build_library

for arg in "$@"; do
# if [[ $arg == "--examples" ]]; then
# build_examples
# fi
#
# if [[ $arg == "--tools" ]]; then
# build_tools
# fi
if [[ $arg == "--examples" ]]; then
if [[ $MAKE_TOOL != "cmake" ]]; then
build_examples
fi
fi

if [[ $arg == "--tools" ]]; then
if [[ $MAKE_TOOL != "cmake" ]]; then
build_tools
fi
fi

if [[ $arg == "--install" ]]; then
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=./libxutils && cmake --build build --target install
#install_library
#install_tools
if [[ $MAKE_TOOL != "cmake" ]]; then
install_library
install_tools
fi
fi
done

Expand Down

0 comments on commit 8b31c56

Please sign in to comment.