Skip to content

Commit 0a4d1cb

Browse files
committed
Electrostatic-application: base files
0 parents  commit 0a4d1cb

File tree

104 files changed

+6669
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+6669
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.buildconfig
2+
.Makefile
3+
# Ignore Gradle project-specific cache directory
4+
.gradle
5+
# Ignore Gradle/CMake build output directory
6+
build
7+
docs/doxygen
8+
cmake-build
9+
.so
10+
.cache
11+
.idea
12+
.vscode

CMakeLists.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
cmake_minimum_required(VERSION 3.18.1)
2+
3+
# define a project with a version
4+
project(electrostatic-application VERSION 1.0)
5+
6+
# To generate compile_commands.json for your project,
7+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8+
9+
###################### CMake Predefined Variables ######################
10+
############################################################
11+
12+
message(STATUS "Project: electrostatic-application")
13+
message(STATUS "Current Output in-comission: ${COMMISSION_OUTPUT}")
14+
message(STATUS "GCC: ${GCC_BIN}")
15+
message(STATUS "GPP: ${GPP_BIN}")
16+
message(STATUS "Compiler Options: ${INPUT_COMPILER_OPTIONS}")
17+
message(STATUS "Target architecture: ${TARGET}")
18+
message(STATUS "Toolchain Headers: ${HEADERS}")
19+
message(STATUS "Source Directory: ${SOURCES_DIR}")
20+
message(STATUS "Project sources: ${PROJECT_SOURCES}")
21+
message(STATUS "Dependencies: ${DEPENDENCIES}")
22+
message(STATUS "Building the binaries to: ${BUILD_DIR}")
23+
24+
###################### CMake Variables ######################
25+
############################################################
26+
27+
set(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${SOURCES_DIR}")
28+
29+
set(commission_exe "${COMMISSION_OUTPUT}.elf")
30+
31+
set(CMAKE_C_COMPILER "${GCC_BIN}")
32+
set(CMAKE_CXX_COMPILER "${GPP_BIN}")
33+
set(COMPILER_OPTIONS "${TARGET} ${INPUT_COMPILER_OPTIONS}")
34+
35+
set(headers "${HEADERS}")
36+
37+
###################### Build routines ######################
38+
############################################################
39+
40+
# build an executable
41+
add_executable(${commission_exe}) # executable based on the static archive
42+
set_target_properties(${commission_exe} PROPERTIES COMPILE_FLAGS "${COMPILER_OPTIONS}" LINK_FLAGS "${COMPILER_OPTIONS}")
43+
# include headers for the target
44+
target_include_directories(${commission_exe} PUBLIC ${lib_headers} ${headers})
45+
target_link_libraries(${commission_exe} PUBLIC "${DEPENDENCIES}")
46+
# Start building the target
47+
target_sources(${commission_exe} PUBLIC "${PROJECT_SOURCES}")
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
function build_sdk_() {
4+
# specify build targets
5+
BUILD_LINUX="${1}"
6+
BUILD_ANDROID="${2}"
7+
BUILD_MCU="${3}"
8+
9+
# compilation
10+
11+
# create the SDK build
12+
13+
# Zip the SDK build into a tar
14+
15+
# publish to maven-central
16+
}
17+
18+
function build_sdk__() {
19+
##
20+
return $?
21+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
function compile() {
4+
local GCC_BIN=${1}
5+
local GPP_BIN=${2}
6+
local INPUT_COMPILER_OPTIONS=${3}
7+
local TARGET=${4}
8+
local TOOLCHAIN_INCLUDES=${5}
9+
local JAVA_HOME=${6}
10+
local ELECTROSTATIC_CORE=${7}
11+
local BUILD_DIR=${8}
12+
local SOURCE_DIR=${9}
13+
14+
local TEMP=$(pwd)
15+
cd ${SOURCE_DIR}
16+
17+
cmake-3.19 "-DGCC_BIN=${GCC_BIN}" \
18+
"-DGPP_BIN=${GPP_BIN}" \
19+
"-DINPUT_COMPILER_OPTIONS=${INPUT_COMPILER_OPTIONS}" \
20+
"-DTARGET=${TARGET}" \
21+
"-DTOOLCHAIN_INCLUDES=${TOOLCHAIN_INCLUDES}" \
22+
"-DJAVA_HOME=${JAVA_HOME}" \
23+
"-DELECTROSTATIC_CORE=${ELECTROSTATIC_CORE}" \
24+
"-DBUILD_DIR=${BUILD_DIR}" \
25+
-S . -B "./cmake-build/${BUILD_DIR}"
26+
27+
cmake --build "./cmake-build/${BUILD_DIR}"
28+
cd ${TEMP}
29+
}
30+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
function compile() {
4+
local COMMISSION_OUTPUT=${1}
5+
local GCC_BIN=${2}
6+
local GPP_BIN=${3}
7+
local INPUT_COMPILER_OPTIONS=${4}
8+
local TARGET=${5}
9+
local HEADERS=${6}
10+
local SOURCES_DIR=${7}
11+
local PROJECT_SOURCES=${8}
12+
local DEPENDENCIES=${9}
13+
local BUILD_DIR=${10}
14+
local CMAKE_DIR=${11}
15+
16+
local TEMP=$(pwd)
17+
18+
cd "${CMAKE_DIR}" || exit $?
19+
20+
cmake-3.19 "-DCOMMISSION_OUTPUT=${COMMISSION_OUTPUT}" \
21+
"-DGCC_BIN=${GCC_BIN}" \
22+
"-DGPP_BIN=${GPP_BIN}" \
23+
"-DINPUT_COMPILER_OPTIONS=${INPUT_COMPILER_OPTIONS}" \
24+
"-DTARGET=${TARGET}" \
25+
"-DHEADERS=${HEADERS}" \
26+
"-DSOURCES_DIR=${SOURCES_DIR}" \
27+
"-DPROJECT_SOURCES=${PROJECT_SOURCES}" \
28+
"-DDEPENDENCIES=${DEPENDENCIES}" \
29+
"-DBUILD_DIR=${BUILD_DIR}" \
30+
-S . -B "$(pwd)/${SOURCES_DIR}/cmake-build/${BUILD_DIR}"
31+
32+
cmake-3.19 --build "$(pwd)/${SOURCES_DIR}/cmake-build/${BUILD_DIR}" || exit $?
33+
34+
cd "${TEMP}" || exit $?
35+
}
36+

0 commit comments

Comments
 (0)