]> git.vomp.tv Git - vompclient.git/commitdiff
Add make-commands script. Remove compiler.sample.
authorChris Tallon <chris@vomp.tv>
Wed, 15 Oct 2025 19:08:01 +0000 (20:08 +0100)
committerChris Tallon <chris@vomp.tv>
Wed, 15 Oct 2025 19:08:01 +0000 (20:08 +0100)
Use -z noexecstack for linker

CMakeLists.txt
cmake.config.sample
compiler.sample [deleted file]
make-commands [new file with mode: 0755]

index 97edaf4febba4e31d290de0b40dca774b0b0eb66..f07078fa6a5205d6ff7de6112e8ae43d40695ff8 100644 (file)
@@ -251,6 +251,8 @@ target_link_directories(vomp PRIVATE
        ${CMAKE_SYSROOT}/opt/vc/lib
        ${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf)
 
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
+
 add_custom_command(
        OUTPUT pngs.o
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res/images
index f285c43a25ac48f29b5879c8c8084948554451af..36136407474e5c1fee6b99c4a67fe63ee07243c7 100644 (file)
@@ -4,7 +4,7 @@ set(CONFIG_CROSS_COMPILE no)
 # Set cross compiler. Options: gcc clang
 set(CONFIG_CROSS_COMPILER gcc)
 
-# Set compiler launcher e.g. for distcc or ccache
+# Set compiler launcher e.g. for distcc or ccache (NOT ON RASPIOS 10)
 # set(CONFIG_COMPILER_LAUNCHER /usr/bin/distcc)
 
 # Use mold for linker? (Only possible if compiler is clang)
diff --git a/compiler.sample b/compiler.sample
deleted file mode 100755 (executable)
index 50bc258..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-# Enable one compiler
-
-/usr/bin/clang-11 "$@"
-# /usr/bin/distcc /usr/bin/clang-11 "$@"
-
diff --git a/make-commands b/make-commands
new file mode 100755 (executable)
index 0000000..f9ebcf8
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/bash
+
+# f clean
+# c cmake
+# b build
+# i install
+# r run
+# a all
+
+
+if test $# -eq 0
+then
+  echo Usage:
+  echo ./go.sh [f] [c] [b] [i] [r] [a]
+  echo f - clean
+  echo c - cmake
+  echo b - build
+  echo i - install
+  echo r - run
+  echo a - all
+fi
+
+CLEAN=0
+CMAKE=0
+BUILD=0
+INSTALL=0
+RUN=0
+MAKERESULT=0
+
+while test $# -gt 0
+do
+  case "$1" in
+    f) CLEAN=1
+    ;;
+    c) CMAKE=1
+    ;;
+    b) BUILD=1
+    ;;
+    i) INSTALL=1
+    ;;
+    r) RUN=1
+    ;;
+    a)
+       CLEAN=1
+       CMAKE=1
+       BUILD=1
+       INSTALL=1
+       RUN=1
+    ;;
+  esac
+  shift
+done
+
+
+if [ $CLEAN -eq 1 ]
+then
+  rm -rf build
+fi
+
+  
+if [ $CMAKE -eq 1 ]
+then
+  if [ ! -d "build" ]; then
+    mkdir build
+    cmake -B build -S git
+  fi
+fi
+
+
+if [ $BUILD -eq 1 ]
+then
+  (cd build; make -j16)
+  MAKERESULT=$?
+fi
+
+if [ $MAKERESULT -ne 0 ] && { [ $INSTALL -eq 1 ] || [ $RUN -eq 1 ]; }
+then
+  echo Install / Run aborted due to make errors
+  exit
+fi
+
+if [ $INSTALL -eq 1 ]
+then
+  echo Insert install commands here
+fi
+
+
+if [ $RUN -eq 1 ]
+then
+  build/vomp
+fi