996
|
1 # - Check if the C compiler supports a specific flag and if yes add it.
|
|
2 # CFUNGE_CHECK_CFLAG(_name _flag)
|
|
3 #
|
|
4 # _name - Name to use for cache variable.
|
|
5 # _flag - Flag to check for
|
|
6 #
|
|
7 # The same variables as for CheckCCompilerFlag affect this macro.
|
|
8 #
|
|
9 # Will set CFUNGE_CHECKFLAG_<name> (as CheckCCompilerFlag out variable).
|
|
10 # Will use add_definitions() to add the <flag> if supported.
|
|
11 #
|
|
12
|
|
13 # cfunge - A standard-conforming Befunge93/98/109 interpreter in C.
|
|
14 # Copyright (C) 2008 Arvid Norlander <anmaster AT tele2 DOT se>
|
|
15 #
|
|
16 # This program is free software: you can redistribute it and/or modify
|
|
17 # it under the terms of the GNU General Public License as published by
|
|
18 # the Free Software Foundation, either version 3 of the License, or
|
|
19 # (at the proxy's option) any later version. Arvid Norlander is a
|
|
20 # proxy who can decide which future versions of the GNU General Public
|
|
21 # License can be used.
|
|
22 #
|
|
23 # This program is distributed in the hope that it will be useful,
|
|
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26 # GNU General Public License for more details.
|
|
27 #
|
|
28 # You should have received a copy of the GNU General Public License
|
|
29 # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30
|
|
31 include(CheckCCompilerFlag)
|
|
32
|
|
33 macro(CFUNGE_CHECK_CFLAG _name _flag)
|
|
34 CHECK_C_COMPILER_FLAG(${_flag} CFUNGE_CHECKFLAG_${_name})
|
|
35 if (CFUNGE_CHECKFLAG_${_name})
|
|
36 add_definitions(${_flag})
|
|
37 endif (CFUNGE_CHECKFLAG_${_name})
|
|
38 endmacro(CFUNGE_CHECK_CFLAG)
|