]> rtime.felk.cvut.cz Git - omk.git/blob - tests/programs-cxxflags
Update wvtool
[omk.git] / tests / programs-cxxflags
1 #!/bin/bash
2
3 . ./functions.sh
4
5 cat > 'test.cc' <<'EOF'
6 #include <stdio.h>
7
8 int main()
9 {
10 #if NUMBER == 123
11         printf("NUMBER is %d\n", NUMBER);
12 #else
13 #  error No NUMBER defined
14 #endif
15         return 0;
16 }
17 EOF
18
19 cat > 'Makefile.omk' <<'EOF'
20 bin_PROGRAMS = test
21
22 test_SOURCES = test.cc
23 EOF
24
25 needs_valid_CC
26 WVPASS make CXXFLAGS=-DNUMBER=123
27
28 if [ $OMK_RULES = linux ]; then
29     # The following should work only with Linux rules
30     _compiled/bin/test|grep 123 || error "Custom CXXFLAGS didn't influence the output"
31 fi