Skip to content

Commit

Permalink
Remove Windows warnings (gazebosim#151)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Aguero <[email protected]>
Signed-off-by: Juan Oxoby <[email protected]>
  • Loading branch information
caguero authored and Juan Oxoby committed Jul 27, 2020
1 parent 09723c4 commit 7ee4db8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions log/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ ign_add_component(log SOURCES ${sources} GET_TARGET_NAME log_lib_target)
target_link_libraries(${log_lib_target}
PRIVATE SQLite3::SQLite3)

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
# by a class are not being exported. These generated source files have private
# members that don't get exported, so they trigger this warning. However, the
# warning is not important since those members do not need to be interfaced
# with.
set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251 /wd4146")
endif()

# Unit tests
ign_build_tests(
TYPE "UNIT"
Expand Down
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ if (MSVC)
list(REMOVE_ITEM gtest_sources ign_TEST.cc)
endif()

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
# by a class are not being exported. These generated source files have private
# members that don't get exported, so they trigger this warning. However, the
# warning is not important since those members do not need to be interfaced
# with.
set_source_files_properties(${sources} ${gtest_sources} COMPILE_FLAGS "/wd4251 /wd4146")
endif()

# Create the library target.
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17)

Expand Down

0 comments on commit 7ee4db8

Please sign in to comment.