From eb09376c4613134bd511ef01d75a939dc01b85e8 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 9 Jun 2024 09:50:11 +0200 Subject: [PATCH] add c enviroment hello world --- .gitignore | 1 + CMakeLists.txt | 13 +++++++++++++ main.c | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..39cd638 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1) + +SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type") + +IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + SET(CMAKE_C_FLAGS "-Wall -g -fsanitize=address") +ENDIF() + +MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") + +PROJECT(feierabend VERSION 0.0.1) + +ADD_EXECUTABLE(${PROJECT_NAME} main.c) \ No newline at end of file diff --git a/main.c b/main.c new file mode 100644 index 0000000..e3bfac7 --- /dev/null +++ b/main.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("Hello World!\n"); + return 0; +} \ No newline at end of file -- 2.39.5