-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathCMakeLists.txt
76 lines (56 loc) · 2.06 KB
/
CMakeLists.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2019 Broadcom.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Broadcom, Inc. - initial API and implementation
cmake_minimum_required(VERSION 3.28)
PROJECT(HlasmLanguageServer LANGUAGES CXX)
option(APPLE_STATIC_CRT "Try linking libc++ statically on Apple." Off)
option(DISCOVER_TESTS "Enables CTest by executing tests and discovering test cases. To disable with: -DDISCOVER_TESTS=Off" On)
option(BUILD_VSIX "When disabled, the VS Code client is not built and it is not packaged into vsix." On)
option(BUILD_VSIX_WEB "Packages Web version of the extension." Off)
option(BUILD_FUZZER "Enable building of the fuzzer. Tested with clang and libstdc++." Off)
set(LANGUAGE_SERVER_BIN_SUBDIR "" CACHE STRING "Subdirectory for the language server binary in the client project")
option(HLASM_DEV_GUESS_BIN_SUBDIR "Try to guess the LANGUAGE_SERVER_BIN_SUBDIR value" Off)
if(BUILD_SHARED_LIBS AND WITH_STATIC_CRT AND MSVC)
message(WARNING "Building shared libraries with static CRT!")
endif()
if(BUILD_FUZZER AND BUILD_SHARED_LIBS)
message(ERROR "Building fuzzer with dynamic libraries not supported.")
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(compiler_flags)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
include(CTest)
include(external_json)
include(external_uri)
include(external_boost)
#Testing setup
if(BUILD_TESTING)
include(external_gtest)
endif()
# Libraries (+ their includes)
add_subdirectory(parser_library)
# Applications
add_subdirectory(language_server)
add_subdirectory(benchmark)
add_subdirectory(utils)
if(BUILD_VSIX)
add_subdirectory(clients)
endif()
# Installation
install(TARGETS
hlasm_language_server
parser_library
hlasm_utils
network-uri
FILE_SET public_headers
)