Skip to content

Commit cec3dcb

Browse files
committed
Initial commit
0 parents  commit cec3dcb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+7150
-0
lines changed

.gitignore

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
build/
2+
output/
3+
/toolchain
4+
.vs/
5+
.vscode/
6+
node_modules/
7+
__pycache__/
8+
9+
# Web
10+
*/dist/**/*
11+
*.js.map
12+
*/Web/Core/dist/*
13+
14+
# Prerequisites
15+
*.d
16+
17+
# Compiled Object files
18+
*.slo
19+
*.lo
20+
*.o
21+
*.obj
22+
23+
# Precompiled Headers
24+
*.gch
25+
*.pch
26+
27+
# Compiled Dynamic libraries
28+
*.so
29+
*.dylib
30+
*.dll
31+
32+
# Fortran module files
33+
*.mod
34+
*.smod
35+
36+
# Compiled Static libraries
37+
*.lai
38+
*.la
39+
*.a
40+
*.lib
41+
42+
# Executables
43+
*.out
44+
*.app
45+
46+
# Visual C++ cache files
47+
ipch/
48+
*.aps
49+
*.ncb
50+
*.opendb
51+
*.opensdf
52+
*.sdf
53+
*.cachefile
54+
*.VC.db
55+
*.VC.VC.opendb
56+
57+
# Visual Studio profiler
58+
*.psess
59+
*.vsp
60+
*.vspx
61+
*.sap
62+
63+
# Files built by Visual Studio
64+
*_i.c
65+
*_p.c
66+
*_i.h
67+
*.ilk
68+
*.meta
69+
*.obj
70+
*.iobj
71+
*.pch
72+
*.pdb
73+
*.ipdb
74+
*.pgc
75+
*.pgd
76+
*.rsp
77+
*.sbr
78+
*.tlb
79+
*.tli
80+
*.tlh
81+
*.tmp
82+
*.tmp_proj
83+
*.log
84+
*.vspscc
85+
*.vssscc
86+
.builds
87+
*.pidb
88+
*.svclog
89+
*.scc
90+
*~
91+
92+
# Files built by Qt
93+
*.autosave
94+
*.txt.user
95+
96+
#Resharper user settings
97+
Folder.DotSettings.user
98+
99+
# ftp test log
100+
tests/ftp/ftpserver/log

CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
4+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
5+
6+
set(BUILD_SHARED ON)
7+
set(CXX_STD cxx_std_17)
8+
9+
# Custom CMake modules/scripts
10+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
11+
include(Common)
12+
include(UseGoldLinker)
13+
14+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
15+
if(UNIX)
16+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
17+
else()
18+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
19+
endif()
20+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
21+
22+
add_compile_definitions(MODULE_NAME="cppbase")
23+
24+
enable_testing()
25+
26+
add_subdirectory(thirdparty)
27+
add_subdirectory(tests)

CMakeSettings.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// 请参阅 https://go.microsoft.com//fwlink//?linkid=834763 了解有关此文件的详细信息。
3+
"configurations": [
4+
{
5+
"name": "x64-Debug",
6+
"generator": "Ninja",
7+
"configurationType": "Debug",
8+
"inheritEnvironments": [ "msvc_x64_x64" ],
9+
"buildRoot": "${projectDir}\\vs2017\\build\\${name}",
10+
"installRoot": "${projectDir}\\vs2017\\install\\${name}",
11+
"cmakeCommandArgs": "",
12+
"buildCommandArgs": "-v",
13+
"ctestCommandArgs": ""
14+
},
15+
{
16+
"name": "x64-Release",
17+
"generator": "Ninja",
18+
"configurationType": "RelWithDebInfo",
19+
"inheritEnvironments": [ "msvc_x64_x64" ],
20+
"buildRoot": "${projectDir}\\vs2017\\build\\${name}",
21+
"installRoot": "${projectDir}\\vs2017\\install\\${name}",
22+
"cmakeCommandArgs": "",
23+
"buildCommandArgs": "-v",
24+
"ctestCommandArgs": ""
25+
}
26+
]
27+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020-2021 O-Net Communications (ShenZhen) Limited
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# O-Net cppbase
2+
3+
C++ base library providing common features for any C++ projects.

cmake/Common.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Instructs CMake to treat warnings as errors for the specified target.
2+
function(set_target_warnings_as_error target)
3+
set(currentlib ${ARGN})
4+
if(MSVC)
5+
target_compile_options(${currentlib} PRIVATE /W4 /WX)
6+
else()
7+
target_compile_options(${currentlib} PRIVATE -Wall -Wextra -pedantic -Werror)
8+
endif()
9+
endfunction(set_target_warnings_as_error)
10+
11+
if (MSVC)
12+
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
13+
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
14+
15+
# -DWIN32_LEAN_AND_MEAN is for winsock.h has already been included error
16+
# -D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING is for warning STL4009
17+
# std::allocator<void> is deprecated in C++17
18+
add_definitions(
19+
-D_WIN32_WINNT=0x0A00
20+
-DNOMINMAX
21+
-DWIN32_LEAN_AND_MEAN
22+
-D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
23+
-D_CRT_SECURE_NO_WARNINGS)
24+
endif()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Distributed under the OSI-approved MIT License. See accompanying
2+
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
3+
4+
cmake_minimum_required(VERSION 2.8.2)
5+
6+
project(${DL_ARGS_PROJ}-download NONE)
7+
8+
include(ExternalProject)
9+
ExternalProject_Add(${DL_ARGS_PROJ}-download
10+
${DL_ARGS_UNPARSED_ARGUMENTS}
11+
SOURCE_DIR "${DL_ARGS_SOURCE_DIR}"
12+
BINARY_DIR "${DL_ARGS_BINARY_DIR}"
13+
CONFIGURE_COMMAND ""
14+
BUILD_COMMAND ""
15+
INSTALL_COMMAND ""
16+
TEST_COMMAND ""
17+
)

0 commit comments

Comments
 (0)