SDCC-C-DetermineCompiler.cmake 652 B

12345678910111213141516
  1. # sdcc, the small devices C compiler for embedded systems,
  2. # http://sdcc.sourceforge.net */
  3. set(_compiler_id_pp_test "defined(__SDCC_VERSION_MAJOR) || defined(SDCC)")
  4. set(_compiler_id_version_compute "
  5. # if defined(__SDCC_VERSION_MAJOR)
  6. # define COMPILER_VERSION_MAJOR @MACRO_DEC@(__SDCC_VERSION_MAJOR)
  7. # define COMPILER_VERSION_MINOR @MACRO_DEC@(__SDCC_VERSION_MINOR)
  8. # define COMPILER_VERSION_PATCH @MACRO_DEC@(__SDCC_VERSION_PATCH)
  9. # else
  10. /* SDCC = VRP */
  11. # define COMPILER_VERSION_MAJOR @MACRO_DEC@(SDCC/100)
  12. # define COMPILER_VERSION_MINOR @MACRO_DEC@(SDCC/10 % 10)
  13. # define COMPILER_VERSION_PATCH @MACRO_DEC@(SDCC % 10)
  14. # endif")