3 include(CheckSourceCompiles)
5 set(C 1) # test that this is tolerated
7 check_source_compiles(C "I don't build" SHOULD_FAIL)
9 message(SEND_ERROR "invalid C source didn't fail.")
12 check_source_compiles(C "int main() {return 0;}" SHOULD_BUILD)
14 message(SEND_ERROR "Test fail for valid C source.")