title: header file dependency is not working with cmake - ninja - GHS compiler
body: <p>The problem is when I edit the header file, No recompile happens and I get ninja: no work to do. message. Is there any fix here that could applied to thousands of c &amp; h files?</p>
  <p>I have a minimal project to illustrate what I have</p>
  <p>src/mainapp.c</p>
  <pre><code>#include&quot;Student.h&quot;
  int main(int argc, char *argv[]){
   x = 0;
  }
  </code></pre>
  <p>src/Student.h</p>
  <pre><code>int x ;
  </code></pre>
  <p>CMakeLists.txt</p>
  <pre><code>make_minimum_required(VERSION 3.19)
  set(CMAKE_TOOLCHAIN_FILE &quot;toolchain_C_Compiler.cmake&quot;)
  project(directory_test C)
  
  set(M4_COMPILER_OPTIONS -c -cpu=cortexm4 -g -dwarf2 -Osize -Xgvared --no_vla --gnu_asm -delete -data_delete --no_commons -no_discard_zero_initializers -preprocess_assembly_files -split_data_sections_by_alignment -individual_data_sections -individual_pragma_data_sections -individual_function_sections -individual_pragma_function_sections -individual_attribute_data_sections -individual_attribute_function_sections -individual_section_name_extra_dot -nostartfiles -align8 --unknown_pragma_errors --incorrect_pragma_errors -retainlocals -thumb -thumb_lib -passsource -fNaN_cmp_unordered -ignore_debug_references --diag_error=incompatible_assignment_operands,pragma_information_conflict,returning_ptr_to_local_variable,subscript_out_of_range,used_before_set,undefined_preproc_id,implicit_func_decl,implicit_return_from_non_void_function --diag_warning=ghs_identical_param_and_return_types_required,ghs_not_enough_initializers,integer_sign_change,missing_type_specifier,nonprototype_function_defined,ghs_pointer_to_larger_alignment --warnings -Wimplicit-int -Wshadow -Wundef --prototype_errors -strict_overlap_check -globalcheck_qualifiers -argcheck=normal -elxr_diag_error=283 -globalcheck=normal -map -keepmap -mapfile_type=2 -Man -Ml -Mu -Mx -Wl,-Ms --no_wrap_diagnostics --brief_diagnostics -DCORE_M4 -DCORE_M4_DME -IC:/Users/MOL4RT/Documents/Bosch/oneSIL/TESTING/swb_cmake/output/bin/CDGB/prp_cdgb/includes_m4_dme -IC:/Users/MOL4RT/Documents/Bosch/oneSIL/TESTING/swb_cmake/output/bin/CDGB/prp_cdgb/bswgen)
  
  # generate static library for source files and archive [.a file]
  add_library(M4_STATIC_LIBARARY STATIC src/mainapp.c)
  target_include_directories(M4_STATIC_LIBARARY PRIVATE src)
  
  target_compile_options(M4_STATIC_LIBARARY PRIVATE ${M4_COMPILER_OPTIONS})
  </code></pre>
  <p>toolchain_C_Compiler.cmake</p>
  <pre><code>set(CMAKE_C_COMPILER &quot;greenhills_arm/comp_201914_1fp_x64/ccarm.exe&quot;)
  set(CMAKE_CXX_COMPILER &quot;greenhills_arm/comp_201914_1fp_x64/cxarm.exe&quot;)
  set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON)
  set(CMAKE_C_OUTPUT_EXTENSION_REPLACE ON)
  </code></pre>