File tree Expand file tree Collapse file tree 2 files changed +40
-4
lines changed Expand file tree Collapse file tree 2 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.10)
2+ project (json-parser VERSION 1.5.2)
3+
4+ set (CMAKE_C_STANDARD 99)
5+ set (CMAKE_C_STANDARD_REQUIRED ON )
6+ set (CMAKE_C_EXTENSIONS OFF )
7+
8+ if (NOT CMAKE_BUILD_TYPE )
9+ set (CMAKE_BUILD_TYPE "Release" )
10+ endif ()
11+
12+ set (CMAKE_C_FLAGS_DEBUG "-O0 -g" )
13+ set (CMAKE_C_FLAGS_RELEASE "-O2" )
14+ set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
15+ set (CMAKE_C_FLAGS_MINSIZEREL "-Os" )
16+
17+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
18+
19+ message (STATUS "Using C compiler: ${CMAKE_C_COMPILER_ID} " )
20+ message (STATUS "Compiler path: ${CMAKE_C_COMPILER} " )
21+
22+ add_library (json-parser STATIC
23+ json_parser.c
24+ )
25+
26+ add_executable (parse_json
27+ test .c
28+ )
29+
30+ target_link_libraries (parse_json json-parser)
31+
32+ add_executable (test_speed
33+ test_speed.c
34+ )
35+
36+ target_link_libraries (test_speed json-parser)
Original file line number Diff line number Diff line change 1- CFLAGS = -g -Wall - std=c99
1+ CFLAGS = -std=c99 -Wall
22ifeq ($(DEBUG ) , y)
3- CFLAGS += -O0
3+ CFLAGS += -O0 -g
44else
55 CFLAGS += -O2
66endif
7- CC = gcc
8- LD = gcc
7+
8+ LD = cc
99
1010all : test_speed parse_json
1111
You can’t perform that action at this time.
0 commit comments