diff --git a/.gitignore b/.gitignore index 66ee80a..f8d8e76 100644 --- a/.gitignore +++ b/.gitignore @@ -201,3 +201,4 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser +vperf diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8a5fc0c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required (VERSION 2.8) + +# veypi +# projectname is the same as the main-executable +project(vperf) + +add_definitions('-g') +add_definitions('-Wall') +#add_definitions('-std=c++11') + + +add_executable(${PROJECT_NAME} main.c test.c) + +#add_custom_target(${PROJECT_NAME}-symlink ALL ln --force -s ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/${PROJECT_NAME} DEPENDS ${PROJECT_NAME}) +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}) diff --git a/include/test.h b/include/test.h new file mode 100644 index 0000000..4972c8f --- /dev/null +++ b/include/test.h @@ -0,0 +1,17 @@ +/* + * test.h + * Copyright (C) 2021 light + * + * Distributed under terms of the MIT license. + */ + +#ifndef TEST_H +#define TEST_H + + +#include + +double get_sqrt(double var1); + + +#endif /* !TEST_H */ diff --git a/main.c b/main.c new file mode 100644 index 0000000..43b9a79 --- /dev/null +++ b/main.c @@ -0,0 +1,19 @@ +/* + * main.c + * Copyright (C) 2021 light + * + * Distributed under terms of the MIT license. + */ + +#include +#include"./include/test.h" + +int main() +{ + double b=25.0; + double a=0.0; + a=get_sqrt(b); + printf("a is %lf, b is %lf\n",a,b); + return 0; +} + diff --git a/test.c b/test.c new file mode 100644 index 0000000..66dacdc --- /dev/null +++ b/test.c @@ -0,0 +1,14 @@ +/* + * test.c + * Copyright (C) 2021 light + * + * Distributed under terms of the MIT license. + */ + +#include "./include/test.h" + + +double get_sqrt(double var1) +{ + return sqrt(var1); +}