Browse Source

Common check target code, allow "native" target

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.0
falkTX 5 years ago
parent
commit
940d4e10e4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 60 additions and 83 deletions
  1. +1
    -41
      bootstrap.sh
  2. +1
    -41
      build-plugin.sh
  3. +50
    -0
      setup/check_target.sh
  4. +8
    -1
      setup/env.sh

+ 1
- 41
bootstrap.sh View File

@@ -16,47 +16,6 @@ fi

# ---------------------------------------------------------------------------------------------------------------------

CROSS_COMPILING=0
MACOS=0
MACOS_OLD=0
WIN32=0
WIN64=0

case ${target} in
"macos")
MACOS=1
;;
"macos-old")
MACOS=1
MACOS_OLD=1
CROSS_COMPILING=1
;;
"win32")
WIN32=1
CROSS_COMPILING=1
;;
"win64")
WIN32=1
WIN64=1
CROSS_COMPILING=1
;;
"native")
echo "TODO"
exit 2
;;
default)
echo "Invalid target '${target}', possible values are:"
echo "\tmacos"
echo "\tmacos-old"
echo "\twin32"
echo "\twin64"
echo "\tnative"
exit 2
;;
esac

# ---------------------------------------------------------------------------------------------------------------------

# TODO check for depedencies:
# - curl
# - cmake
@@ -66,6 +25,7 @@ esac
# - sed
# - tar

source setup/check_target.sh
source setup/env.sh
source setup/functions.sh
source setup/versions.sh


+ 1
- 41
build-plugin.sh View File

@@ -19,47 +19,7 @@ fi

# ---------------------------------------------------------------------------------------------------------------------

CROSS_COMPILING=0
MACOS=0
MACOS_OLD=0
WIN32=0
WIN64=0

case ${target} in
"macos")
MACOS=1
;;
"macos-old")
MACOS=1
MACOS_OLD=1
CROSS_COMPILING=1
;;
"win32")
WIN32=1
CROSS_COMPILING=1
;;
"win64")
WIN32=1
WIN64=1
CROSS_COMPILING=1
;;
"native")
echo "TODO"
exit 2
;;
default)
echo "Invalid target '${target}', possible values are:"
echo "\tmacos"
echo "\tmacos-old"
echo "\twin32"
echo "\twin64"
echo "\tnative"
exit 2
;;
esac

# ---------------------------------------------------------------------------------------------------------------------

source setup/check_target.sh
source setup/env.sh
source setup/functions.sh
source setup/versions.sh


+ 50
- 0
setup/check_target.sh View File

@@ -0,0 +1,50 @@
#!/bin/bash

CROSS_COMPILING=0
LINUX=0
MACOS=0
MACOS_OLD=0
WIN32=0
WIN64=0

function check_target() {

case ${target} in
"macos")
MACOS=1
;;
"macos-old")
MACOS=1
MACOS_OLD=1
CROSS_COMPILING=1
;;
"win32")
WIN32=1
CROSS_COMPILING=1
;;
"win64")
WIN32=1
WIN64=1
CROSS_COMPILING=1
;;
"Linux")
LINUX=1
;;
"native")
target=$(uname -s)
check_target
;;
default)
echo "Invalid target '${target}', possible values are:"
echo "\tmacos"
echo "\tmacos-old"
echo "\twin32"
echo "\twin64"
echo "\tnative"
exit 2
;;
esac

}

check_target

+ 8
- 1
setup/env.sh View File

@@ -10,6 +10,7 @@ if [ "${MACOS}" -eq 1 ]; then
else
PAWPAW_TARGET="macos"
fi

elif [ "${WIN32}" -eq 1 ]; then
CMAKE_SYSTEM_NAME="Windows"
if [ "${WIN64}" -eq 1 ]; then
@@ -17,8 +18,14 @@ elif [ "${WIN32}" -eq 1 ]; then
else
PAWPAW_TARGET="win32"
fi

elif [ "${LINUX}" -eq 1 ]; then
CMAKE_SYSTEM_NAME="Linux"
PAWPAW_TARGET="linux"

else
PAWPAW_TARGET="native"
echo "Unknown target '${target}'"
exit 4
fi

# ---------------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save