noloader / cryptopp-cmake

CMake files for Crypto++ project
BSD 3-Clause "New" or "Revised" License
92 stars 68 forks source link

dont double-add CRYPTOPP_COMPILE_DEFINITIONS #81

Closed lawilog closed 2 years ago

lawilog commented 2 years ago

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.

noloader commented 2 years ago

Thanks @lawidog.

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

lawilog commented 2 years ago

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.

abdes commented 2 years ago

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