Search code examples
assemblycmakefasm

How to add FASM support to CMake


does anyone know how to add FASM support to CMake? I've tried an original guide here , but it doesn't work for me.


Solution

  • So , I managed to add three files as said here in my CMake\share\cmake-3.7\Modules\ directory (I'm using Windows ):

    • CMakeDetermineASM_FASMCompiler.cmake :

      set(ASM_DIALECT "_FASM")
      set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST fasm)
      include(CMakeDetermineASMCompiler)
      set(ASM_DIALECT)
      
    • CMakeTestASM_FASMCompiler.cmake:

      set(ASM_DIALECT "_FASM")
      include(CMakeTestASMCompiler)
      set(ASM_DIALECT)
      
    • CMakeASM_FASMInformation.cmake:

      set(ASM_DIALECT "_FASM")
      set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
      set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <SOURCE> <OBJECT>")
      include(CMakeASMInformation)
      set(ASM_DIALECT)
      

    Do not forget to include FASM directory to your Path variable

    And it works gracefully!