build(init): added cmake build system and clang tidy files
This commit is contained in:
parent
8cbf40bd63
commit
6b3850bc84
3 changed files with 67 additions and 0 deletions
11
.clang-tidy
Normal file
11
.clang-tidy
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Checks: >
|
||||
clang-analyzer-*,
|
||||
bugprone-*,
|
||||
performance-*,
|
||||
readability-*,
|
||||
portability-*,
|
||||
cppcoreguidelines-*,
|
||||
-clang-analyzer-osx*,
|
||||
-cppcoreguidelines-pro-type-vararg
|
||||
WarningsAsErrors: ''
|
||||
FormatStyle: file
|
||||
29
CMakeLists.txt
Normal file
29
CMakeLists.txt
Normal file
|
|
@ -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()
|
||||
27
Tests/Main.c
Normal file
27
Tests/Main.c
Normal file
|
|
@ -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 <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("Hello, World!\n");
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue