running CLion
on Linux
, I've been trying to get .asm files to work. This is how my test project looks like (it worked 100%
on Windows/Mac
, only had to add .intel_syntax
in the .asm
file).
Installed the NASM
Assembly Support plugin.
main.c:
#include <stdio.h>
extern long tes(long);
int main() {
printf("%ld", tes(5));
printf("Hello, World!\n");
return 0;
}
tes.asm:
.text:
.global tes
tes:
mov rax, edi
ret
CMakeLists.txt:
cmake_minimum_required(VERSION 3.15)
project(Testt C)
enable_language(C ASM)
set(CMAKE_C_STANDARD 99)
set ( SOURCES
main.c
tes.asm)
add_executable(program ${SOURCES} )
How do I configure CLion
so as to use tes
as a method in C
? I'm expecting tes(x) = x
, but somehow, my project doesn't compile:
====================[ Build | program | Debug ]=================================
/snap/clion/99/bin/cmake/linux/bin/cmake --build /home/user/CLionProjects/Testt/cmake-build-debug --target program -- -j 4
make: *** No rule to make target 'program'. Stop.
Any help is appreciated!