Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Commit 5e26d52

Browse files
committed
build(C): use CMake
1 parent 6750d3d commit 5e26d52

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CMakeLists.txt.user
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
_deps
12+
build

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.0.0)
2+
project(CRC32Craker VERSION 0.1.0)
3+
4+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
5+
link_libraries(m)
6+
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
7+
8+
9+
add_executable(crack main.c)

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
## 使用
66

77
```shell
8+
# Python
89
python main.py [crc32hash]
910

10-
gcc -O3 -o main main.c -lm
11-
./main [crc32hash]
11+
# C
12+
mkdir build
13+
cmake ..
14+
make
15+
./crack [crc32hash]
1216
```
1317

1418
## 鸣谢

0 commit comments

Comments
 (0)