aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lemon/CMakeLists.txt
blob: 529eeae11de0dc57725ea04be6415e8f3cbc98e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

add_executable(lemon lemon.c)

if(DEFINED LEMON_C_COMPILER)
	set(CMAKE_C_COMPILER "${LEMON_C_COMPILER}")
	set(CMAKE_C_FLAGS "")
endif()

# To keep lemon.c as close to upstream as possible disable all warnings
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
	target_compile_options(lemon PRIVATE /w)
else()
	target_compile_options(lemon PRIVATE -w)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
	# Disable static analysis for lemon source code. These issues don't
	# affect Wireshark at runtime.
	target_compile_options(lemon PRIVATE -Xclang -analyzer-disable-all-checks)
endif()
if(DEFINED NO_SANITIZE_CFLAGS)
	target_compile_options(lemon PRIVATE ${NO_SANITIZE_CFLAGS})
endif()
if(DEFINED NO_SANITIZE_LDFLAGS)
	target_link_options(lemon PRIVATE ${NO_SANITIZE_LDFLAGS})
endif()

#
# Editor modelines  -  https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#