title: Compile ASM and C with ASM for debugging
body: <p>I have two small files that I want to compile in CMake for debugging it with CLion and GDB</p>
  
  <p>main.c</p>
  
  <pre><code>int my_strlen(char *);
  
  int main()
  {
      printf("Test: %d\n", my_strlen("Hello"));
  }
  </code></pre>
  
  <p>and I have my ASM file that have a my_strlen file</p>
  
  <pre><code>    [BITS 64]
  
      global my_strlen
      section .text
  
  my_strlen:
      push rbp
      mov rbp, rsp
      xor rcx, rcx
  
  loop:
      cmp BYTE [rdi + rcx], 0
      jz end
      inc rcx
      jmp loop
  
  end:
      mov rax, rcx
      mov rsp, rbp
      leave
      ret
  </code></pre>
  
  <p>I'm trying to compile with a CMakeList.txt I add set_source_files_properties but it still doesn't work</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.9)
  project(ASM)
  
  set(CMAKE_CXX_STANDARD 11)
  set_source_files_properties(src/strlen.asm PROPERTIES COMPILE_FLAGS "-x assembler-with-c")
  
  add_executable(main
          src/strlen.asm
          tests/src/main.c)
  </code></pre>
  
  <p>Someone knows a good command to add ASM file in a C project and compile with a CMakeList.txt ?</p>