PchInstantiateTemplates-check.cmake 773 B

1234567891011121314151617
  1. file(STRINGS ${RunCMake_TEST_BINARY_DIR}/compile_commands.json empty_dir_commands
  2. REGEX "command.*-fpch-instantiate-templates.*empty.dir/cmake_pch[A-Za-z0-9_.]*.h")
  3. file(STRINGS ${RunCMake_TEST_BINARY_DIR}/compile_commands.json foo_dir_commands
  4. REGEX "command.*-fpch-instantiate-templates.*foo.dir/cmake_pch[A-Za-z0-9_.]*.h")
  5. list(LENGTH empty_dir_commands empty_dir_commands_size)
  6. list(LENGTH foo_dir_commands foo_dir_commands_size)
  7. if (empty_dir_commands_size EQUAL 0)
  8. set(RunCMake_TEST_FAILED "empty target should have -fpch-instantiate-templates compile option present")
  9. return()
  10. endif()
  11. if (foo_dir_commands_size GREATER 0)
  12. set(RunCMake_TEST_FAILED "foo target should not have -fpch-instantiate-templates compile option present")
  13. return()
  14. endif()