AbiName.cmake 502 B

123456789101112
  1. function(AbiName_get outputVar flags)
  2. try_compile(compileResult
  3. ${CMAKE_BINARY_DIR}/okcompilers/
  4. ${CMAKE_SOURCE_DIR}/okcompilers/abiname_xcompile.c
  5. CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${flags}
  6. OUTPUT_VARIABLE compileOut
  7. )
  8. message("Testing ABI type returned [${compileOut}]")
  9. string(REGEX MATCH "ABI_IS_[^ ]*__" abi "${compileOut}")
  10. string(REGEX REPLACE "ABI_IS_(.*)__" "\\1" abi "${abi}")
  11. set(${outputVar} ${abi} PARENT_SCOPE)
  12. endfunction()