Skip to content

Commit e89a018

Browse files
committed
更改文件编码为UTF-8, 使用cmake构建
1 parent d94c994 commit e89a018

18 files changed

+196
-81
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.vs/
22
x64/
3+
cmake-build-debug/
4+
*.pdb.idea/

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/editor.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/json-parser-homework.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
cmake_minimum_required(VERSION 3.27)
2+
3+
PROJECT(JsonParser C)
4+
set(CMAKE_C_STANDARD 17)
5+
6+
add_library(jsonParserLib
7+
core/Json.h
8+
core/parser.h
9+
core/JsonValue.h
10+
core/JsonArray.h
11+
core/JsonObject.h
12+
core/JsonString.h
13+
core/outputer.h
14+
core/parser.c
15+
core/JsonValue.c
16+
core/JsonArray.c
17+
core/JsonObject.c
18+
core/JsonString.c
19+
core/outputer.c
20+
)
21+
22+
add_executable(json
23+
cli/main.c
24+
)
25+
target_include_directories(json PRIVATE
26+
core
27+
)
28+
target_link_libraries(json PRIVATE
29+
jsonParserLib
30+
)
31+
32+
add_library(cutest
33+
cutest/CuTest.h
34+
cutest/CuTest.c
35+
)
36+
37+
add_executable(string_test
38+
test/stringTest.c
39+
)
40+
41+
target_include_directories(string_test PRIVATE
42+
core
43+
cutest
44+
)
45+
target_link_libraries(string_test PRIVATE
46+
cutest
47+
jsonParserLib
48+
)
49+
50+
enable_testing()
51+
add_test(
52+
NAME "String Test"
53+
COMMAND string_test
54+
)

0 commit comments

Comments
 (0)