Skip to content

Commit e0158c0

Browse files
authored
Add -Wno-error=redundant-move to cmake builds (firebase#13582)
1 parent b0dbeb8 commit e0158c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmake/compiler_setup.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
include(CheckCXXCompilerFlag)
16+
1517
# C++ Compiler setup
1618

1719
# We use C++14
@@ -76,6 +78,14 @@ if(CXX_CLANG OR CXX_GNU)
7678
list(APPEND common_flags -fdiagnostics-color)
7779
endif()
7880
endif()
81+
82+
# Disable treating "redundant-move" as an error since it's not really a problem,
83+
# and is even a valid coding style to over-use std::move() in case the type is
84+
# ever changed to become non-trivially moveable.
85+
CHECK_CXX_COMPILER_FLAG("-Wno-error=redundant-move" FIREBASE_CXX_COMPILER_FLAG_REDUNDANT_MOVE_SUPPORTED)
86+
if(FIREBASE_CXX_COMPILER_FLAG_REDUNDANT_MOVE_SUPPORTED)
87+
list(APPEND common_flags -Wno-error=redundant-move)
88+
endif()
7989
endif()
8090

8191
if(APPLE)

0 commit comments

Comments
 (0)