File: TestInline.cmake

package info (click to toggle)
fluidsynth 2.1.7-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,052 kB
  • sloc: ansic: 39,171; xml: 706; cpp: 151; sh: 46; makefile: 21
file content (15 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
include ( CheckCSourceCompiles )
foreach ( _keyword "inline" "__inline__" "__inline" )
    if ( NOT INLINE_KEYWORD )
        set ( CMAKE_REQUIRED_DEFINITIONS "-DTESTKEYWORD=${_keyword}" )
        check_c_source_compiles ( 
            "typedef int foo_t;
             static TESTKEYWORD foo_t static_foo(){return 0;}
             foo_t foo(){return 0;}
             int main(int argc, char *argv[]){return 0;}"
            _have_${_keyword} )
        if ( _have_${_keyword} )
            set ( INLINE_KEYWORD ${_keyword} )
        endif ( _have_${_keyword} )
    endif ( NOT INLINE_KEYWORD )
endforeach ( _keyword )