diff --git a/etc/bashrc b/etc/bashrc index 8fefa32b0631bfee011303cc1bceb984ea4b311d..60030f8ce9cd5ced9f291672e201448c4c8492a1 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -94,6 +94,7 @@ export WM_COMPILE_OPTION=Opt # +ccache : use ccache # +xcrun : use xcrun and native compilers [MacOS] # +strict : more deprecation warnings (may generate *many* warnings) +# ++strict : even more deprecation warnings # ccache=... : ccache command (unquoted, single/double or <> quoted) # version=... : compiler suffix (eg, version=11 -> gcc-11) # lnInclude-extra : add '-extra' option for wmakeLnInclude diff --git a/etc/cshrc b/etc/cshrc index fc8520fab81ca78a0596286417663e8aba49f6da..b36054eabd4975b995b4f0d52b547b2fb6fab26e 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -94,6 +94,7 @@ setenv WM_COMPILE_OPTION Opt # +ccache : use ccache # +xcrun : use xcrun and native compilers [MacOS] # +strict : more deprecation warnings (may generate *many* warnings) +# ++strict : even more deprecation warnings # ccache=... : ccache command (unquoted, single/double or <> quoted) # version=... : compiler suffix (eg, version=11 -> gcc-11) # lnInclude-extra : add '-extra' option for wmakeLnInclude diff --git a/src/OpenFOAM/include/stdFoam.H b/src/OpenFOAM/include/stdFoam.H index a34e34e09487587c944e6816b750df3fa56d75a4..24cf6c14b305d7d632ad9632470005fdd4e3ad13 100644 --- a/src/OpenFOAM/include/stdFoam.H +++ b/src/OpenFOAM/include/stdFoam.H @@ -46,7 +46,20 @@ Description #define FOAM_DEPRECATED(since) [[deprecated("Since " #since)]] #define FOAM_DEPRECATED_FOR(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] -#define FOAM_DEPRECATED_STRICT(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] + +#ifdef FOAM_COMPILE_STRICT +# define FOAM_DEPRECATED_STRICT(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] +# if (FOAM_COMPILE_STRICT > 1) +# define FOAM_DEPRECATED_STRICTER(since, replacement) [[deprecated("Since " #since "; use " #replacement)]] +# endif +#endif + +#ifndef FOAM_DEPRECATED_STRICT +#define FOAM_DEPRECATED_STRICT(since, replacement) +#endif +#ifndef FOAM_DEPRECATED_STRICTER +#define FOAM_DEPRECATED_STRICTER(since, replacement) +#endif // Branch prediction helpers. With C++20 can use [[likely]], [[unlikely]] #if defined(__GNUC__) || defined(__clang__) diff --git a/wmake/makefiles/general b/wmake/makefiles/general index cea6c58690923a9376ee582654fcc95127fc1f2a..d2b9b4e9c1436f8af489f9f05909a4a83782d369 100644 --- a/wmake/makefiles/general +++ b/wmake/makefiles/general @@ -6,7 +6,7 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2019-2023 OpenCFD Ltd. +# Copyright (C) 2019-2025 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -23,6 +23,13 @@ # WM_COMPILE_CONTROL (~openfoam) # WM_OSTYPE (windows) # +# User modification entries. Usually specified in Make/options +# +# EXE_INC : defines/includes etc for executable or library targets +# EXE_LIBS : linking for executables +# LIB_LIBS : linking for libraries (.so) +# LIBO_LIBS : linking for object libraries (.o) +# #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ @@ -74,6 +81,7 @@ endif EXE_INC = EXE_LIBS = LIB_LIBS = +LIBO_LIBS = # Project include/libraries PROJECT_INC = \ @@ -229,7 +237,7 @@ $(LIB).o: $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f $(LIB).o $(call QUIET_MESSAGE,ld,$(LIB).o) - $E $(LD) -r -o $(LIB).o $(OBJECTS) + $E $(LD) -r -o $(LIB).o $(OBJECTS) $(LIBO_LIBS) #------------------------------------------------------------------------------ diff --git a/wmake/rules/General/general b/wmake/rules/General/general index dcfadee8ee0acac531c18064ad234df1cbc89652..028c83a78dae2e0e829b85370fe83b59c00aea74 100644 --- a/wmake/rules/General/general +++ b/wmake/rules/General/general @@ -34,7 +34,11 @@ endif # Enable additional compile-time checks ifneq (,$(findstring +strict,$(WM_COMPILE_CONTROL))) - GFLAGS += -DFOAM_COMPILE_STRICT + ifneq (,$(findstring ++strict,$(WM_COMPILE_CONTROL))) + GFLAGS += -DFOAM_COMPILE_STRICT=2 + else + GFLAGS += -DFOAM_COMPILE_STRICT + endif endif # Default compilation is 'Opt' - never permit an empty value diff --git a/wmake/rules/General/transform b/wmake/rules/General/transform index 202d0a2a2b0192af01f7093b1cb8472d063466bd..9e29954d6b3907311e79426b8316a74bf2818736 100644 --- a/wmake/rules/General/transform +++ b/wmake/rules/General/transform @@ -11,6 +11,10 @@ WMKDEP := $(WMAKE_BIN)/wmkdepend WMKDEP_FLAGS := -eWM_PROJECT_DIR -eWM_THIRD_PARTY_DIR +ifneq (,$(strip $(WM_QUIET))) + WMKDEP_FLAGS += -q +endif + ifneq (,$(strip $(WM_QUIET))) E=@ define QUIET_MESSAGE diff --git a/wmake/wmake b/wmake/wmake index 86353e98b816d0876bd65c798ed12c99ac438214..0f78d955d16264a6b810be852deaae41c4a68ef8 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -270,7 +270,8 @@ do ;; -strict) - opt_strict="+strict" + # Generate +strict (single use), ++strict (multiple use) + opt_strict="+${opt_strict:-strict}" ;; -build-root=*) @@ -529,16 +530,9 @@ esac # Handle -strict flag(s) if [ -n "$opt_strict" ] then - # Add +strict into WM_COMPILE_CONTROL - opt_strict="${WM_COMPILE_CONTROL:+ }+strict" - case "$WM_COMPILE_CONTROL" in - (*+strict*) - # Appears to have already been added - ;; - (*) - export WM_COMPILE_CONTROL="${WM_COMPILE_CONTROL}${opt_strict}" - ;; - esac + # Add +strict, ++strict, ... into WM_COMPILE_CONTROL + WM_COMPILE_CONTROL="${WM_COMPILE_CONTROL} ${opt_strict}" + export WM_COMPILE_CONTROL fi