Add_definitions (- CRT_SECURE_NO_WARNINGS)
Add_definitions (- _CRT_SECURE_NO_WARNINGS)
Add_definitions (_CRT_SECURE_NO_WARNINGS)
These are I have tried so far. These attempts are not successful.
CodePudding user response:
Use this:If (MSVC)
Add_definitions (- D_CRT_SECURE_NO_WARNINGS)
Endif ()
About the official document, please refer to here. The general form is:
Add_definitions (DFOO - DBAR... )
Please note that if it applies to a single target, you should use target_compile_definitions.
CodePudding user response:
https://stackoverflow.com/questions/40779571/adding-crt-secure-no-warnings-definition-using-cmakeNing is the translation machine