diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..78a89d5 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,11 @@ +Checks: > + clang-analyzer-*, + bugprone-*, + performance-*, + readability-*, + portability-*, + cppcoreguidelines-*, + -clang-analyzer-osx*, + -cppcoreguidelines-pro-type-vararg +WarningsAsErrors: '' +FormatStyle: file \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b5caa37 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.10) +project(Iony C) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) + +include_directories(${PROJECT_SOURCE_DIR}/Include) +file(GLOB_RECURSE SRC_FILES "${PROJECT_SOURCE_DIR}/Src/*.c") + +add_library(Iony STATIC ${SRC_FILES}) +add_executable(IonyTest ${PROJECT_SOURCE_DIR}/Tests/Main.c) + +target_link_libraries(Iony PRIVATE ${HALLOCY_LIB_PATH}) +target_include_directories(IonyTest PRIVATE ${PROJECT_SOURCE_DIR}/Tests) +target_link_libraries(IonyTest Iony) + +if (MSVC) + target_compile_options(Iony PRIVATE /W4 /Zl) +else() + if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + target_compile_options(Iony PRIVATE -mavx512f -mavx512vl -march=native) + target_compile_options(IonyTest PRIVATE -mavx512f -mavx512vl -march=native) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + target_compile_options(Iony PRIVATE -mfpu=neon) + target_compile_options(IonyTest PRIVATE -mfpu=neon) + endif() + + target_compile_options(Iony PRIVATE -Wall -Wextra -pedantic) +endif() \ No newline at end of file diff --git a/Tests/Main.c b/Tests/Main.c new file mode 100644 index 0000000..a0ba57d --- /dev/null +++ b/Tests/Main.c @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ----------------------------------------------------------------------------- + * File: Main.c + * Description: + * Executes all tests. + * + * Author: Mineplay + * ----------------------------------------------------------------------------- + */ +#include + +int main(void) { + printf("Hello, World!\n"); + return 0; +} \ No newline at end of file