Fix: Shared lib tests fail during build for CUDA,TRT,DML (#20453)
The order of defines for these test have to be in the same order. If we
check for TRT -> CUDA ->DML wen cannot reverse that order in later
defines as we might want to build for multiple EPs.
+@PatriceVignola