Skip to content

Commit 09f8168

Browse files
committed
Initial commit
1 parent ebc9c2a commit 09f8168

8 files changed

+420
-0
lines changed

.clang-tidy

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Checks: >-
2+
clang-analyzer-*,
3+
clang-diagnostic-*,
4+
bugprone-*,
5+
-bugprone-easily-swappable-parameters,
6+
-bugprone-exception-escape,
7+
cppcoreguidelines-avoid-goto,
8+
google-*,
9+
modernize-*,
10+
performance-*,
11+
readability-*,
12+
readability-identifier-naming,
13+
-cppcoreguidelines-avoid-*,
14+
-cppcoreguidelines-init-variables,
15+
-cppcoreguidelines-non-private-member-variables-in-classes,
16+
-cppcoreguidelines-owning-memory,
17+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
18+
-cppcoreguidelines-pro-bounds-constant-array-index,
19+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
20+
-cppcoreguidelines-pro-type-reinterpret-cast,
21+
-cppcoreguidelines-pro-type-vararg,
22+
-modernize-avoid-c-arrays,
23+
-modernize-use-trailing-return-type,
24+
-performance-avoid-endl,
25+
-readability-convert-member-functions-to-static,
26+
-readability-function-cognitive-complexity,
27+
-readability-identifier-length,
28+
-readability-isolate-declaration,
29+
-readability-magic-numbers,
30+
-readability-uppercase-literal-suffix,
31+
WarningsAsErrors: ''
32+
HeaderFileExtensions:
33+
- ''
34+
- h
35+
- hh
36+
- hpp
37+
- hxx
38+
ImplementationFileExtensions:
39+
- c
40+
- cc
41+
- cpp
42+
- cxx
43+
HeaderFilterRegex: ''
44+
AnalyzeTemporaryDtors: false
45+
FormatStyle: file
46+
CheckOptions:
47+
readability-identifier-naming.ClassMethodCase: 'camelBack'
48+
49+
SystemHeaders: false

.clangd

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CompileFlags:
2+
Add:
3+
- -Wall
4+
- -Wextra
5+
- -std=c++23
6+
CompilationDatabase: ./build
7+
8+
Diagnostics:
9+
UnusedIncludes: Strict
10+
11+
InlayHints:
12+
Enabled: true
13+
ParameterNames: true
14+
DeducedTypes: true
15+
16+
Hover:
17+
ShowAKA: true
18+
19+
# vim:ft=yaml

.gitignore

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
### https://raw.github.com/github/gitignore/b0012e4930d0a8c350254a3caeedf7441ea286a3/Global/macOS.gitignore
2+
build*
3+
cmake_build
4+
.build
5+
_build
6+
7+
# General
8+
.DS_Store
9+
.AppleDouble
10+
.LSOverride
11+
12+
# Icon must end with two \r
13+
Icon
14+
15+
16+
# Thumbnails
17+
._*
18+
19+
# Files that might appear in the root of a volume
20+
.DocumentRevisions-V100
21+
.fseventsd
22+
.Spotlight-V100
23+
.TemporaryItems
24+
.Trashes
25+
.VolumeIcon.icns
26+
.com.apple.timemachine.donotpresent
27+
28+
### https://raw.github.com/github/gitignore/b0012e4930d0a8c350254a3caeedf7441ea286a3/C++.gitignore
29+
30+
# Prerequisites
31+
*.d
32+
33+
# Compiled Object files
34+
*.slo
35+
*.lo
36+
*.o
37+
*.obj
38+
39+
# Precompiled Headers
40+
*.gch
41+
*.pch
42+
43+
# Compiled Dynamic libraries
44+
*.so
45+
*.dylib
46+
*.dll
47+
48+
# Fortran module files
49+
*.mod
50+
*.smod
51+
52+
# Compiled Static libraries
53+
*.lai
54+
*.la
55+
*.a
56+
*.lib
57+
58+
# Executables
59+
*.exe
60+
*.out
61+
*.app

CMakeLists.txt

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
cmake_minimum_required(VERSION 3.28)
2+
3+
project(Argo CXX)
4+
5+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6+
set(CMAKE_CXX_STANDARD 23)
7+
8+
# Setting Build Type
9+
if(NOT CMAKE_BUILD_TYPE)
10+
set(CMAKE_BUILD_TYPE "Debug")
11+
endif()
12+
13+
# set release flag
14+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math")
15+
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
16+
17+
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
18+
19+
set(CMAKE_CXX_FLAGS
20+
"-Wall -Wextra -Werror -Wnon-virtual-dtor -Wfloat-equal -Winline")
21+
22+
add_library(Argo)
23+
24+
file(GLOB LIBRARY_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/*.cc
25+
${CMAKE_CURRENT_LIST_DIR}/src/**/*.cc)
26+
file(GLOB LIBRARY_MODULE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/*.ccm
27+
${CMAKE_CURRENT_LIST_DIR}/src/**/*.ccm)
28+
target_sources(Argo PUBLIC FILE_SET CXX_MODULES FILES ${LIBRARY_SOURCES}
29+
${LIBRARY_MODULE_SOURCES})
30+
31+
add_executable(main main.cc)
32+
target_link_libraries(main Argo)

Taskfile.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://taskfile.dev
2+
3+
version: '3'
4+
5+
vars:
6+
GREETING: Hello, World!
7+
8+
tasks:
9+
cmake:
10+
cmds:
11+
- cmake -B build -S . -GNinja
12+
env:
13+
CC: /usr/local/opt/llvm/bin/clang
14+
CXX: /usr/local/opt/llvm/bin/clang++
15+
default:
16+
cmds:
17+
- echo "{{.GREETING}}"
18+
silent: true

main.cc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import std_modules;
2+
3+
auto main() -> int {
4+
#ifndef NDEBUG
5+
std::cout << "Hello World DBUG" << std::endl;
6+
#else
7+
std::cout << "Hello World" << std::endl;
8+
#endif
9+
return 0;
10+
}

src/Argo.ccm

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module;
2+
3+
export module Argo;

0 commit comments

Comments
 (0)