# HG changeset patch # User Olaf Wintermann # Date 1736684615 -3600 # Node ID 95ae5973c1423d0925eed04e2e1e084b604c5c8e # Parent 59b14b75f12b4f6403c4a20f6b05909437f75e91 move debug/release flags from target to general flags, fixes #571 diff -r 59b14b75f12b -r 95ae5973c142 src/main/resources/make/configure.vm --- 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 diff -r 59b14b75f12b -r 95ae5973c142 test/configure --- 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__ diff -r 59b14b75f12b -r 95ae5973c142 test/make/configure.vm --- 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