aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/winpty/src/CMakeLists.txt
blob: 22b15111d4f6a2179b123d6c459a17d2a770fe32 (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
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
104
105
106
107
108
109
110
111
if (MSVC)
    add_compile_definitions(NOMINMAX UNICODE _UNICODE)
endif()

file(WRITE ${CMAKE_BINARY_DIR}/GenVersion.h.in [=[
const char GenVersion_Version[] = "@VERSION@";
const char GenVersion_Commit[] = "@COMMIT_HASH@";
]=])

file(READ ../VERSION.txt VERSION)
string(REPLACE "\n" "" VERSION "${VERSION}")
configure_file(${CMAKE_BINARY_DIR}/GenVersion.h.in ${CMAKE_BINARY_DIR}/GenVersion.h @ONLY)

set(shared_sources
    shared/AgentMsg.h
    shared/BackgroundDesktop.h
    shared/BackgroundDesktop.cc
    shared/Buffer.h
    shared/Buffer.cc
    shared/DebugClient.h
    shared/DebugClient.cc
    shared/GenRandom.h
    shared/GenRandom.cc
    shared/OsModule.h
    shared/OwnedHandle.h
    shared/OwnedHandle.cc
    shared/StringBuilder.h
    shared/StringUtil.cc
    shared/StringUtil.h
    shared/UnixCtrlChars.h
    shared/WindowsSecurity.cc
    shared/WindowsSecurity.h
    shared/WindowsVersion.h
    shared/WindowsVersion.cc
    shared/WinptyAssert.h
    shared/WinptyAssert.cc
    shared/WinptyException.h
    shared/WinptyException.cc
    shared/WinptyVersion.h
    shared/WinptyVersion.cc
    shared/winpty_snprintf.h
)

#
# winpty-agent
#

add_qtc_executable(winpty-agent
  INCLUDES
    include ${CMAKE_BINARY_DIR}
  DEFINES WINPTY_AGENT_ASSERT
  PROPERTIES QT_COMPILE_OPTIONS_DISABLE_WARNINGS ON
  SOURCES
    agent/Agent.h
    agent/Agent.cc
    agent/AgentCreateDesktop.h
    agent/AgentCreateDesktop.cc
    agent/ConsoleFont.cc
    agent/ConsoleFont.h
    agent/ConsoleInput.cc
    agent/ConsoleInput.h
    agent/ConsoleInputReencoding.cc
    agent/ConsoleInputReencoding.h
    agent/ConsoleLine.cc
    agent/ConsoleLine.h
    agent/Coord.h
    agent/DebugShowInput.h
    agent/DebugShowInput.cc
    agent/DefaultInputMap.h
    agent/DefaultInputMap.cc
    agent/DsrSender.h
    agent/EventLoop.h
    agent/EventLoop.cc
    agent/InputMap.h
    agent/InputMap.cc
    agent/LargeConsoleRead.h
    agent/LargeConsoleRead.cc
    agent/NamedPipe.h
    agent/NamedPipe.cc
    agent/Scraper.h
    agent/Scraper.cc
    agent/SimplePool.h
    agent/SmallRect.h
    agent/Terminal.h
    agent/Terminal.cc
    agent/UnicodeEncoding.h
    agent/Win32Console.cc
    agent/Win32Console.h
    agent/Win32ConsoleBuffer.cc
    agent/Win32ConsoleBuffer.h
    agent/main.cc
    ${shared_sources}
)

#
# libwinpty
#

add_qtc_library(winpty STATIC
  INCLUDES ${CMAKE_BINARY_DIR}
  PUBLIC_DEFINES COMPILING_WINPTY_DLL
  PROPERTIES QT_COMPILE_OPTIONS_DISABLE_WARNINGS ON
  SOURCES
    libwinpty/AgentLocation.cc
    libwinpty/AgentLocation.h
    libwinpty/winpty.cc
    ${shared_sources}
)

target_include_directories(winpty
  PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)