Fixes several problems encountered with CMake 3.18+:
-
Deprecated old version support. Solved by updating our minimums everywhere to 3.7 which was already our top-level minimum. At this point it should be fine to require clients to use 3.7 too.
-
Assembly compilation breakage from two factors:
A) The CMake-generated define -Ddynamorio_EXPORTS is being passed as --defsym dynamorio_EXPORTS in for asm targets, but we pass that to cpp.
B) Various compiler flags like --MD are in and cpp does not like them.
My solution for assembly is to:
-
set(CMAKE_ASM_DEFINE_FLAG "-D")
-
Remove from the cpp command for asm. We do end up needing "-mavx*" to set the built-in defines AVX, etc. I put in explicit setting of "-mavx*" using the existing avx support queries, shifted earlier during config.
-
Move all of our preprocessor defines from COMPILE_FLAGS properties with explicit -D to COMPILE_DEFINITIONS properites without -D so we get them in .
This was a little involved:
-
There were a number of places pasing defines as flags.
-
COMPILE_FLAGS is a string while COMPILE_DEFINITIONS is a list, necessitating some conversions and changes in handling.
-
I had to split out a new function DynamoRIO_extra_defines from DynamoRIO_extra_cflags. I maintained the get_DynamoRIO_defines interface.
-
I had to update several places like in test setup where we remove defines to avoid duplicates from the command line and configure.h.
-
Fixes #4370 (closed)