Skip to content

Commit

Permalink
block MASM : warning A4018 when building cryptopp in windows with ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
betterpig committed Dec 6, 2021
1 parent 7b1bb87 commit 9e13a32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmake/external/cryptopp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ SET(CRYPTOPP_TAG CRYPTOPP_8_2_0)

IF(WIN32)
SET(CRYPTOPP_LIBRARIES "${CRYPTOPP_INSTALL_DIR}/lib/cryptopp-static.lib" CACHE FILEPATH "cryptopp library." FORCE)
# There is a compilation parameter 'FI\"winapifamily.h\"' can't be used correctly
# There is a compilation parameter "/FI\"winapifamily.h\"" or "/FIwinapifamily.h" can't be used correctly
# with Ninja on Windows. The only difference between the patch file and original
# file is that the compilation parameters are changed to 'FIwinapifamily.h'. This
# file is that the compilation parameters are changed to '/nologo'. This
# patch command can be removed when upgrading to a higher version.
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set(CRYPTOPP_PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PADDLE_SOURCE_DIR}/patches/cryptopp/CMakeLists.txt" "<SOURCE_DIR>/")
Expand Down
2 changes: 1 addition & 1 deletion patches/cryptopp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ if (MSVC)
if (CMAKE_SYSTEM_VERSION MATCHES "10\\.0.*")
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS "_WIN32_WINNT=0x0A00")
endif ()
list(APPEND CRYPTOPP_COMPILE_OPTIONS "/FIwinapifamily.h")
list(APPEND CRYPTOPP_COMPILE_OPTIONS "/nologo")
endif ()

# Enable PIC for all target machines except 32-bit i386 due to register pressures.
Expand Down

1 comment on commit 9e13a32

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.