From b85ef617d051dc89807855dfb513def9ecac6d1c Mon Sep 17 00:00:00 2001 From: MrGeorgen Date: Thu, 5 Nov 2020 16:24:35 +0100 Subject: [PATCH] basic j2 setup --- CMakeLists.txt | 3 ++- j2-Baulwuerfe/CMakeLists.txt | 4 ++++ j2-Baulwuerfe/src/main.c | 14 ++++++++++++++ lib/acl | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 j2-Baulwuerfe/CMakeLists.txt create mode 100644 j2-Baulwuerfe/src/main.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d83e1..fc04976 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,5 +2,6 @@ project(bwinf C) cmake_minimum_required(VERSION 3.17) set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) set_property(GLOBAL PROPERTY C_STANDARD 99) -add_subdirectory("lib/acl") +include_directories("lib/acl/include") +add_subdirectory("lib/acl" EXCLUDE_FROM_ALL) add_subdirectory("j1-Passwoerter") diff --git a/j2-Baulwuerfe/CMakeLists.txt b/j2-Baulwuerfe/CMakeLists.txt new file mode 100644 index 0000000..53e3424 --- /dev/null +++ b/j2-Baulwuerfe/CMakeLists.txt @@ -0,0 +1,4 @@ +file(GLOB J2SOURCES "src/*.c") +file(GLOB ACLSOURCES "../lib/acl/src/*.c") +add_executable(j2 ${J1SOURCES} ${ACLSOURCES}) +target_link_libraries(j2 PRIVATE m) diff --git a/j2-Baulwuerfe/src/main.c b/j2-Baulwuerfe/src/main.c new file mode 100644 index 0000000..9dd7a9e --- /dev/null +++ b/j2-Baulwuerfe/src/main.c @@ -0,0 +1,14 @@ +#include + +void pointerCheck(void *pointer) { + if(pointer == NULL) { + perror("Error: "); + exit(-1); + } +} + +int main(int argc, char *argv[]) { + if(argc != 2) printf("file argument required"); + bool sucess; + FILE *fp = fopen(argv[1], "rb"); + char *input = acl_ReadTextFile(fp, &sucess); diff --git a/lib/acl b/lib/acl index 285f43f..a83de1b 160000 --- a/lib/acl +++ b/lib/acl @@ -1 +1 @@ -Subproject commit 285f43f65a8037471948e83c719edc67046c3244 +Subproject commit a83de1b97b4c58b09696c62a53d446763b21bb50