Skip to content

Commit

Permalink
block MASM : warning A4018 when building cryptopp in windows with nin…
Browse files Browse the repository at this point in the history
  • Loading branch information
betterpig authored and Zjq9409 committed Dec 10, 2021
1 parent d5d0bb7 commit f39bf5b
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

0 comments on commit f39bf5b

Please sign in to comment.