allow to force installing a clangd and qtcreator files
Add a forceclangd target to Makefile to force installing a .clangd file. Add a forceqtcreator target to force installing qtcreator files. Existing files will be overwritten. while here: - update the c++ standard to c++23
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
CompileFlags:
|
CompileFlags:
|
||||||
Add: [-pthread, -std=c++20, -I%%%CURRENT_DIR%%%/src, -I%%%GLOBAL_WORKING_DIR%%%/morm/src, -I/usr/include, -I/usr/local/include, -DPT_HAS_MORM_LIBRARY]
|
Add: [-pthread, -std=c++23, -I%%%CURRENT_DIR%%%/src, -I%%%GLOBAL_WORKING_DIR%%%/morm/src, -I/usr/include, -I/usr/local/include, -DPT_HAS_MORM_LIBRARY]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
-std=c20
|
-std=c23
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
-std=c++20
|
-std=c++23
|
||||||
|
|||||||
@@ -5,6 +5,14 @@ GLOBAL_WORKING_DIR=$(realpath ${CURRENT_DIR}/..)
|
|||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
|
has_force_arg=0
|
||||||
|
|
||||||
|
if [ $# -eq 1 ] ; then
|
||||||
|
if [ $1 == 'force' ] ; then
|
||||||
|
has_force_arg=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# make sure the current directory is correct
|
# make sure the current directory is correct
|
||||||
if [ ! -d ${CURRENT_DIR}/.templates ] ; then
|
if [ ! -d ${CURRENT_DIR}/.templates ] ; then
|
||||||
echo "this script should be called by make: make clangd (one level up)"
|
echo "this script should be called by make: make clangd (one level up)"
|
||||||
@@ -17,7 +25,7 @@ GLOBAL_WORKING_DIR_FOR_SED=$(echo ${GLOBAL_WORKING_DIR} | sed 's/\//\\\//g')
|
|||||||
|
|
||||||
|
|
||||||
if [ -f "${CURRENT_DIR}/.templates/.clangd" ] ; then
|
if [ -f "${CURRENT_DIR}/.templates/.clangd" ] ; then
|
||||||
if [ ! -f "${CURRENT_DIR}/.clangd" ] ; then
|
if [ $has_force_arg -eq 1 -o ! -f "${CURRENT_DIR}/.clangd" ] ; then
|
||||||
cat "${CURRENT_DIR}/.templates/.clangd" | \
|
cat "${CURRENT_DIR}/.templates/.clangd" | \
|
||||||
sed -e "s/%%%CURRENT_DIR%%%/${CURRENT_DIR_FOR_SED}/g" \
|
sed -e "s/%%%CURRENT_DIR%%%/${CURRENT_DIR_FOR_SED}/g" \
|
||||||
-e "s/%%%GLOBAL_WORKING_DIR%%%/${GLOBAL_WORKING_DIR_FOR_SED}/g" > \
|
-e "s/%%%GLOBAL_WORKING_DIR%%%/${GLOBAL_WORKING_DIR_FOR_SED}/g" > \
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ QTCREATOR_DIR=${CURRENT_DIR}/.qtcreator
|
|||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
|
has_force_arg=0
|
||||||
|
|
||||||
|
if [ $# -eq 1 ] ; then
|
||||||
|
if [ $1 == 'force' ] ; then
|
||||||
|
has_force_arg=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# make sure the current directory is correct
|
# make sure the current directory is correct
|
||||||
if [ ! -d ${CURRENT_DIR}/.templates ] ; then
|
if [ ! -d ${CURRENT_DIR}/.templates ] ; then
|
||||||
echo "this script should be called by make: make qtcreator (one level up)"
|
echo "this script should be called by make: make qtcreator (one level up)"
|
||||||
@@ -48,6 +56,10 @@ GLOBAL_WORKING_DIR_FOR_SED=$(echo ${GLOBAL_WORKING_DIR} | sed 's/\//\\\//g')
|
|||||||
|
|
||||||
was_qtcreator_dir=0
|
was_qtcreator_dir=0
|
||||||
|
|
||||||
|
if [ $has_force_arg -eq 1 ] ; then
|
||||||
|
rm -rf "${QTCREATOR_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "${QTCREATOR_DIR}" ] ; then
|
if [ -d "${QTCREATOR_DIR}" ] ; then
|
||||||
was_qtcreator_dir=1
|
was_qtcreator_dir=1
|
||||||
else
|
else
|
||||||
@@ -76,7 +88,7 @@ if [ -d "${QTCREATOR_DIR}" ] ; then
|
|||||||
|
|
||||||
if [ $was_qtcreator_dir -eq 0 ] ; then
|
if [ $was_qtcreator_dir -eq 0 ] ; then
|
||||||
echo "QTCreator files generated to ${QTCREATOR_DIR} directory"
|
echo "QTCreator files generated to ${QTCREATOR_DIR} directory"
|
||||||
echo "select an 'open project...' option and find a ${QTCREATOR_DIR}/*.creator file"
|
echo "In QTCreator select an 'open project...' option and find a ${QTCREATOR_DIR}/*.creator file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -102,4 +114,3 @@ if [ -d "${QTCREATOR_DIR}" ] ; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,29 +17,29 @@ tests: FORCE
|
|||||||
$(MAKE) -C tests
|
$(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
tests-gcc11: FORCE
|
tests-gcc15: FORCE
|
||||||
env CXX=g++11 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc11/ -Wall -pedantic -O0 -g3 -std=c++20 -fmax-errors=1 -I../src -I/usr/local/include" $(MAKE) -C src
|
env CXX=g++15 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc15/ -Wall -pedantic -O0 -g3 -std=c++23 -fmax-errors=1 -I../src -I/usr/local/include" $(MAKE) -C src
|
||||||
env CXX=g++11 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc11/ -Wall -pedantic -O0 -g3 -std=c++20 -fmax-errors=1 -I../src -I/usr/local/include" $(MAKE) -C tests
|
env CXX=g++15 CXXFLAGS="-Wl,-rpath=/usr/local/lib/gcc15/ -Wall -pedantic -O0 -g3 -std=c++23 -fmax-errors=1 -I../src -I/usr/local/include" $(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
tests-clang: FORCE
|
tests-clang: FORCE
|
||||||
env CXX=clang++ CXXFLAGS="-Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C src
|
env CXX=clang++ CXXFLAGS="-Wall -pedantic -O0 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C src
|
||||||
env CXX=clang++ CXXFLAGS="-Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C tests
|
env CXX=clang++ CXXFLAGS="-Wall -pedantic -O0 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
tests-clang-sa: FORCE
|
tests-clang-sa: FORCE
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=address -Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C src
|
env CXX=clang++ CXXFLAGS="-fsanitize=address -Wall -pedantic -O0 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C src
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=address -Wall -pedantic -O0 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C tests
|
env CXX=clang++ CXXFLAGS="-fsanitize=address -Wall -pedantic -O0 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
tests-clang-sm: FORCE
|
tests-clang-sm: FORCE
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=memory -Wall -pedantic -O3 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C src
|
env CXX=clang++ CXXFLAGS="-fsanitize=memory -Wall -pedantic -O3 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C src
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=memory -Wall -pedantic -O3 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C tests
|
env CXX=clang++ CXXFLAGS="-fsanitize=memory -Wall -pedantic -O3 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
tests-clang-su: FORCE
|
tests-clang-su: FORCE
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=undefined -Wall -pedantic -O3 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C src
|
env CXX=clang++ CXXFLAGS="-fsanitize=undefined -Wall -pedantic -O3 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C src
|
||||||
env CXX=clang++ CXXFLAGS="-fsanitize=undefined -Wall -pedantic -O3 -g3 -std=c++20 -I../src -I/usr/local/include" $(MAKE) -C tests
|
env CXX=clang++ CXXFLAGS="-fsanitize=undefined -Wall -pedantic -O3 -g3 -std=c++23 -I../src -I/usr/local/include" $(MAKE) -C tests
|
||||||
|
|
||||||
|
|
||||||
clean: FORCE
|
clean: FORCE
|
||||||
@@ -56,9 +56,17 @@ clangd: FORCE
|
|||||||
@.templates/install_clangd.sh
|
@.templates/install_clangd.sh
|
||||||
|
|
||||||
|
|
||||||
|
forceclangd: FORCE
|
||||||
|
@.templates/install_clangd.sh force
|
||||||
|
|
||||||
|
|
||||||
qtcreator: clangd
|
qtcreator: clangd
|
||||||
@.templates/install_qtcreator.sh
|
@.templates/install_qtcreator.sh
|
||||||
|
|
||||||
|
|
||||||
|
forceqtcreator: forceclangd
|
||||||
|
@.templates/install_qtcreator.sh force
|
||||||
|
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user