Skip to content

Commit

Permalink
[build] CMake: add some flags from native-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Jul 12, 2024
1 parent 9671055 commit 55a88f3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include(CPack)
include(OptionValidation)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${WPILIB_BINARY_DIR}/lib)
Expand Down
6 changes: 5 additions & 1 deletion apriltag/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ if(MSVC)
else()
target_compile_options(
apriltag
PRIVATE -Wno-sign-compare -Wno-gnu-zero-variadic-macro-arguments -Wno-type-limits
PRIVATE
-Wno-sign-compare
-Wno-gnu-zero-variadic-macro-arguments
-Wno-type-limits
-Wno-format-nonliteral
)
endif()

Expand Down
11 changes: 2 additions & 9 deletions cmake/modules/CompileWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ macro(wpilib_target_warnings target)
-pedantic
-Wextra
-Wno-unused-parameter
${WPILIB_TARGET_WARNINGS}
-Wformat=2
)
if(NOT NO_WERROR)
set(WARNING_FLAGS ${WARNING_FLAGS} -Werror)
Expand All @@ -15,14 +15,7 @@ macro(wpilib_target_warnings target)
else()
target_compile_options(
${target}
PRIVATE
/wd4146
/wd4244
/wd4251
/wd4267
/WX
/D_CRT_SECURE_NO_WARNINGS
${WPILIB_TARGET_WARNINGS}
PRIVATE /wd4146 /wd4244 /wd4251 /wd4267 /WX /D_CRT_SECURE_NO_WARNINGS
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion wpiutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ target_compile_features(wpiutil PUBLIC cxx_std_20)
if(MSVC)
target_compile_options(
wpiutil
PUBLIC /permissive- /Zc:preprocessor /Zc:throwingNew /MP /bigobj
PUBLIC /permissive- /Zc:preprocessor /Zc:throwingNew /Zc:__cplusplus /MP /bigobj /utf-8 /FS
)
target_compile_definitions(wpiutil PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()
Expand Down

0 comments on commit 55a88f3

Please sign in to comment.