This repository was archived by the owner on Jan 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathCMakeLists.txt
103 lines (81 loc) · 2.28 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required(VERSION 3.0.0)
project(glsl-language-server)
find_package(Threads REQUIRED)
option(USE_SYSTEM_LIBS "Use system libraries" OFF)
option(HTTP_SUPPORT "Enable HTTP support" ON)
if (HTTP_SUPPORT)
add_definitions(-DHAVE_HTTP_SUPPORT)
endif()
if (USE_SYSTEM_LIBS)
find_package(glslang REQUIRED)
message(STATUS "found package glslang, version: ${glslang_VERSION}")
find_package(fmt REQUIRED)
message(STATUS "found package fmt, version: ${fmt_VERSION}")
find_package(nlohmann_json REQUIRED)
message(STATUS "found package nlohmann_json, version: ${nlohmann_json_VERSION}")
find_package(CLI11 REQUIRED)
message(STATUS "found package CLI11, version: ${CLI11_VERSION}")
if (HTTP_SUPPORT)
find_library(mongoose mongoose)
if (mongoose)
message(STATUS "found library mongoose located in: ${mongoose}")
else()
message(FATAL_ERROR "mongoose library not found")
endif()
endif()
else()
add_subdirectory(externals/glslang EXCLUDE_FROM_ALL)
add_subdirectory(externals/fmt EXCLUDE_FROM_ALL)
add_subdirectory(externals/json EXCLUDE_FROM_ALL)
include_directories(
externals/json/include
)
include_directories(
externals/CLI11/include
)
if (HTTP_SUPPORT)
add_library(mongoose externals/mongoose/mongoose.c)
include_directories(
externals/mongoose
)
endif()
endif()
set(CMAKE_CXX_STANDARD 20)
file(GLOB SOURCES
src/*.cpp
)
include_directories(src)
add_executable(glslls
${SOURCES}
)
if (MSVC)
target_compile_options(glslls PRIVATE /W4)
else()
target_compile_options(glslls PRIVATE -Wall -Wextra -Wpedantic)
endif()
target_link_libraries(glslls
${CMAKE_THREAD_LIBS_INIT}
glslang
nlohmann_json
SPIRV
fmt::fmt-header-only
)
if (USE_SYSTEM_LIBS)
target_link_libraries(glslls
glslang::glslang
glslang::glslang-default-resource-limits
)
if (HTTP_SUPPORT)
target_link_libraries(glslls ${mongoose})
endif()
else()
target_sources(glslls PRIVATE externals/glslang/glslang/ResourceLimits/ResourceLimits.cpp)
target_link_libraries(glslls
glslang
nlohmann_json
mongoose
)
endif()
install(TARGETS glslls
RUNTIME DESTINATION bin
)