forked from eclipse-4diac/4diac-forte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_zephyr.sh
82 lines (73 loc) · 2.84 KB
/
setup_zephyr.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
echo "----------------------------------------------------------------------------"
echo " Automatically set up development environment for Zephyr-platform"
echo "----------------------------------------------------------------------------"
echo ""
echo " Includes 64bit-datatypes, float-datatypes, Ethernet-Interface,"
echo " ASN1-encoding, ..."
echo ""
echo " To include tests set directories for boost-test-framework and "
echo " set FORTE_TESTS-option to 'ON'"
echo ""
echo "----------------------------------------------------------------------------"
export forte_src_dir=${PWD}
export forte_bin_dir="bin/zephyr"
export FORTE_BUILDSUPPORT_DIRECTORY="${PWD}/buildsupport"
export forte_external_modules_dir="${PWD}/ExportedFBs"
#set to boost-include directory
export forte_boost_test_inc_dirs=""
#set to boost-library directory
export forte_boost_test_lib_dirs=""
if [ ! -d "$forte_bin_dir" ]; then
mkdir -p "$forte_bin_dir"
fi
if [ -d "$forte_bin_dir" ]; then
echo "For building forte go to $forte_bin_dir and execute \"ninja\""
echo "forte can be found at ${forte_bin_dir}/src"
echo "forte_tests can be found at ${forte_bin_dir}/tests"
cd "./$forte_bin_dir"
for arg in "$@"; do
export "$arg"
done
cmake -G "Ninja" \
-DCMAKE_C_COMPILER_WORKS=ON \
-DCMAKE_CXX_COMPILER_WORKS=ON \
-DNULLPTR_SUPPORTED=ON \
-DCMAKE_SYSTEM_NAME=Generic \
-DFORTE_ARCHITECTURE=Zephyr \
-DFORTE_TESTS=OFF \
-DFORTE_SUPPORT_BOOT_FILE=ON \
-DFORTE_BUILD_EXECUTABLE=OFF \
-DFORTE_BUILD_STATIC_LIBRARY=ON \
-DFORTE_MODULE_CONVERT=ON \
-DFORTE_MODULE_IEC61131=ON \
-DFORTE_IO=ON \
-DFORTE_IO_ZEPHYR=ON \
-DFORTE_COM_ETH=ON \
-DFORTE_COM_FBDK=ON \
-DFORTE_COM_LOCAL=ON \
-DFORTE_MODULE_UTILS=ON \
-DFORTE_EXTERNAL_MODULES_DIRECTORY="${forte_external_modules_dir}" \
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" \
-DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" \
-DFORTE_LOGLEVEL=LOGINFO \
-DCMAKE_BUILD_TYPE=MINSIZEREL \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \
-DCMAKE_C_FLAGS_DEBUG="-g ${CMAKE_C_FLAGS}" \
-DCMAKE_C_FLAGS_MINSIZEREL="-Os -DNDEBUG ${CMAKE_C_FLAGS}" \
-DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG ${CMAKE_C_FLAGS}" \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG ${CMAKE_C_FLAGS}" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \
-DCMAKE_CXX_FLAGS_DEBUG="-g ${CMAKE_CXX_FLAGS}" \
-DCMAKE_CXX_FLAGS_MINSIZEREL="-Os -DNDEBUG ${CMAKE_CXX_FLAGS}" \
-DCMAKE_CXX_FLAGS_RELEASE="-O3 -DNDEBUG ${CMAKE_CXX_FLAGS}" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG ${CMAKE_CXX_FLAGS}" \
-DFORTE_ZEPHYR_INCLUDES="${FORTE_ZEPHYR_INCLUDES}" \
-DFORTE_SOURCE_DIR="${forte_src_dir}" \
-DFORTE_TESTS_INC_DIRS="${forte_boost_test_inc_dirs}" \
-DFORTE_TESTS_LINK_DIRS="${forte_boost_test_inc_dirs}" \
../../
else
echo "unable to create ${forte_bin_dir}"
exit 1
fi