Edit

kc3-lang/libevent/cmake/CheckFunctionKeywords.cmake

Branch :

  • Show log

    Commit

  • Author : Mark Ellzey
    Date : 2015-12-19 01:47:49
    Hash : 8b228e27
    Message : Lot's of cmake updates This is still not done, cmake here was a horrid mess, but we're getting our act together now.

  • cmake/CheckFunctionKeywords.cmake
  • include(CheckCSourceCompiles)
    
    macro(check_function_keywords _wordlist)
      set(${_result} "")
      foreach(flag ${_wordlist})
        string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}")
        string(TOUPPER "${flagname}" flagname)
        set(have_flag "HAVE_${flagname}")
        check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag})
        if(${have_flag} AND NOT ${_result})
          set(${_result} "${flag}")
        endif(${have_flag} AND NOT ${_result})
      endforeach(flag)
    endmacro(check_function_keywords)