On Sun, Mar 29, 2020 at 12:50:52PM -0500, stes wrote:
There is a
IF (CMAKE_COMPILER_IS_GNUCC)
so I could use that
but the IF (__SUNPRO_C) doesn't seem to work
in C source files I use __SUNPRO_C like in
platforms/unix/vm/include_ucontext.h:#elif __SUNPRO_C && __i386__
but I don't think that the config.cmake is "preprocessed" by cc -E.
The nicest solution seems CMAKE_<LANG>_COMPILER_VERSION or possibly IF (CMAKE_COMPILER_IS_GNUCC)
You are right, CMAKE_C_COMPILER_VERSION is the nicest solution.
I changed the line in platforms/unix/vm/config.cmake to this:
SET (VM_BUILD_STRING ""Unix built on "__DATE__ " "__TIME__" Compiler: ${CMAKE_C_COMPILER_VERSION}"")
This produces the correct output on Linux with gcc, so if it works also on Solaris then I think it is the right fix.
I am attaching a copy of the full config.cmake file for reference.
Can you check and see if this works on Solaris?
Thanks, Dave