cryptopp-cmake icon indicating copy to clipboard operation
cryptopp-cmake copied to clipboard

dont double-add CRYPTOPP_COMPILE_DEFINITIONS

Open lawilog opened this issue 2 years ago • 2 comments

Otherwise, if you run cmake -D DISABLE_ASM=ON . && make VERBOSE=1 you will get a compiler invocation like /usr/bin/c++ -DCRYPTOPP_DISABLE_ASM -O2 -g -DNDEBUG -fPIC CRYPTOPP_DISABLE_ASM -o CMakeFiles/cryptopp-object.dir/cryptlib.cpp.o -c /path/cryptopp/cryptlib.cpp

with "c++: error: CRYPTOPP_DISABLE_ASM" file not found (it is twice in the command line options, once with -D and once without it).

This should fix it.

lawilog avatar Mar 23 '22 14:03 lawilog

Thanks @lawidog.

Would it be better to fix the cause of CRYPTOPP_DISABLE_ASM (instead of -DCRYPTOPP_DISABLE_ASM)?

noloader avatar Mar 28 '22 09:03 noloader

I am not sure I understand your question. I believe that the list CRYPTOPP_COMPILE_DEFINITIONS is correctly filled (just a list of options without -D prefix). That means it can be added used with add_compile_definitions(). But it must not be added using add_compile_options(), as that would require to add the prefix -D to each option beforehand.

lawilog avatar May 09 '22 15:05 lawilog

This should be fixed in the latest master branch - please check.

abdes avatar Aug 22 '22 17:08 abdes