Skip to content

Commit 079481c

Browse files
committed
remove /W0 -w flags
1 parent 0140fd1 commit 079481c

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

third-party/CMakeLists.txt

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ add_subdirectory( "${CMAKE_CURRENT_LIST_DIR}/rsutils" )
66
string(REPLACE "${SECURITY_COMPILER_FLAGS}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # remove security flags
77
string(REPLACE "${SECURITY_COMPILER_FLAGS}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
88

9-
if (MSVC)
10-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0 ") # ignore all warnings from third party
11-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0 ")
12-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
13-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w ") # ignore all warnings from third party
14-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w ")
15-
endif()
16-
17-
message(STATUS "flags are ${CMAKE_CXX_FLAGS}")
189
include(CMake/external_json.cmake)
1910
# Add additional include directories to allow file to include rosbag headers
2011
include(${_rel_path}/realsense-file/config.cmake)
@@ -30,14 +21,6 @@ if( BUILD_WITH_DDS )
3021
add_subdirectory( "${CMAKE_CURRENT_LIST_DIR}/realdds" )
3122
endif()
3223

33-
34-
if (MSVC)
35-
string(REPLACE "/W0" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # remove /W0
36-
string(REPLACE "/W0" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
37-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
38-
string(REPLACE "-w " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # remove -w
39-
string(REPLACE "-w " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
40-
endif()
41-
24+
# restore flags
4225
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SECURITY_COMPILER_FLAGS}")
43-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SECURITY_COMPILER_FLAGS}")
26+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SECURITY_COMPILER_FLAGS}")

0 commit comments

Comments
 (0)