Sun, 12 Jan 2025 13:23:35 +0100
move debug/release flags from target to general flags, fixes #571
--- a/src/main/resources/make/configure.vm Sun Jan 12 12:45:11 2025 +0100 +++ b/src/main/resources/make/configure.vm Sun Jan 12 13:23:35 2025 +0100 @@ -485,6 +485,16 @@ done #end +# build type +if [ "$BUILD_TYPE" = "debug" ]; then + TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" +fi +if [ "$BUILD_TYPE" = "release" ]; then + TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" +fi + # add general dependency flags to flags.mk echo "# general flags" >> "$TEMP_DIR/flags.mk" if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then @@ -661,22 +671,6 @@ if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" fi -if [ "$BUILD_TYPE" = "debug" ]; then - if [ -n "$lang_c" ]; then - echo '${target.cFlags} += ${DEBUG_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo '${target.cxxFlags} += ${DEBUG_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi -if [ "$BUILD_TYPE" = "release" ]; then - if [ -n "$lang_c" ]; then - echo '${target.cFlags} += ${RELEASE_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo '${target.cxxFlags} += ${RELEASE_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi if [ -n "${TEMP_LDFLAGS}" ]; then echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" fi
--- a/test/configure Sun Jan 12 12:45:11 2025 +0100 +++ b/test/configure Sun Jan 12 13:23:35 2025 +0100 @@ -524,6 +524,16 @@ break done +# build type +if [ "$BUILD_TYPE" = "debug" ]; then + TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" +fi +if [ "$BUILD_TYPE" = "release" ]; then + TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" +fi + # add general dependency flags to flags.mk echo "# general flags" >> "$TEMP_DIR/flags.mk" if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then @@ -599,22 +609,6 @@ if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" fi -if [ "$BUILD_TYPE" = "debug" ]; then - if [ -n "$lang_c" ]; then - echo 'CFLAGS += ${DEBUG_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo 'CXXFLAGS += ${DEBUG_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi -if [ "$BUILD_TYPE" = "release" ]; then - if [ -n "$lang_c" ]; then - echo 'CFLAGS += ${RELEASE_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo 'CXXFLAGS += ${RELEASE_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi if [ -n "${TEMP_LDFLAGS}" ]; then echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" fi @@ -647,7 +641,7 @@ # # config.mk generated by: # pwd: $pwd -# cmd: $0 $@ +# $0 $@ # __EOF__
--- a/test/make/configure.vm Sun Jan 12 12:45:11 2025 +0100 +++ b/test/make/configure.vm Sun Jan 12 13:23:35 2025 +0100 @@ -485,6 +485,16 @@ done #end +# build type +if [ "$BUILD_TYPE" = "debug" ]; then + TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" +fi +if [ "$BUILD_TYPE" = "release" ]; then + TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" + TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" +fi + # add general dependency flags to flags.mk echo "# general flags" >> "$TEMP_DIR/flags.mk" if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then @@ -661,22 +671,6 @@ if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" fi -if [ "$BUILD_TYPE" = "debug" ]; then - if [ -n "$lang_c" ]; then - echo '${target.cFlags} += ${DEBUG_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo '${target.cxxFlags} += ${DEBUG_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi -if [ "$BUILD_TYPE" = "release" ]; then - if [ -n "$lang_c" ]; then - echo '${target.cFlags} += ${RELEASE_CFLAGS}' >> "$TEMP_DIR/flags.mk" - fi - if [ -n "$lang_cpp" ]; then - echo '${target.cxxFlags} += ${RELEASE_CXXFLAGS}' >> "$TEMP_DIR/flags.mk" - fi -fi if [ -n "${TEMP_LDFLAGS}" ]; then echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" fi