@@ -9,127 +9,81 @@ set(ECTOOL_COMMON_SOURCES
9
9
misc_util.cc
10
10
crc.cc
11
11
comm-host.cc
12
- lock/gec_lock.cc
13
- )
12
+ lock/gec_lock.cc )
14
13
15
14
if (NOT WIN32 )
16
- list (APPEND ECTOOL_COMMON_SOURCES
17
- comm-dev.cc
18
- comm-i2c.cc
19
- comm-lpc.cc
20
- comm-servo-spi.cc
21
- comm-usb.cc
22
- lock/file_lock.cc
23
- )
15
+ list (
16
+ APPEND
17
+ ECTOOL_COMMON_SOURCES
18
+ comm-dev.cc
19
+ comm-i2c.cc
20
+ comm-lpc.cc
21
+ comm-servo-spi.cc
22
+ comm-usb.cc
23
+ lock/file_lock.cc )
24
24
else ()
25
- list (APPEND ECTOOL_COMMON_SOURCES
26
- comm-win32.cc
27
- lock/win32_mutex_lock.cc
28
- )
25
+ list (APPEND ECTOOL_COMMON_SOURCES comm-win32.cc lock/win32_mutex_lock.cc )
29
26
endif ()
30
27
31
-
32
-
33
28
# ============================
34
29
# Add Executable Target: ectool
35
30
# ============================
36
31
add_executable (ectool ectool.cc ${ECTOOL_COMMON_SOURCES} )
37
32
38
- target_include_directories (ectool PRIVATE
39
- ../include
40
- ${libusb_INCLUDE_DIRS}
41
- )
33
+ target_include_directories (ectool PRIVATE ../include ${libusb_INCLUDE_DIRS} )
42
34
43
- target_compile_definitions (ectool PRIVATE
44
- CHROMIUM_EC
45
- EXTERNAL_ECTOOL_BUILD
46
- )
35
+ target_compile_definitions (ectool PRIVATE CHROMIUM_EC EXTERNAL_ECTOOL_BUILD )
47
36
48
- target_compile_options (ectool PRIVATE
49
- -Wno-c99-designator
50
- -Wno-address-of-packed-member
51
- -Wno-format-security
52
- )
37
+ target_compile_options (
38
+ ectool PRIVATE -Wno-c99-designator -Wno-address-of-packed-member
39
+ -Wno-format-security )
53
40
54
41
if (WIN32 )
55
- target_compile_definitions (ectool PRIVATE
56
- _CRT_SECURE_NO_WARNINGS
57
- )
58
- target_link_libraries (ectool PRIVATE
59
- getopt
60
- CrosECDriver
61
- onecoreuap_apiset.lib
62
- )
63
- if (MSVC )
64
- target_compile_options (ectool PRIVATE
65
- /FI "..\\ include\\ win32_shim.h"
66
- )
67
- else ()
68
- target_compile_options (ectool PRIVATE
69
- -include "..\\ include\\ win32_shim.h"
70
- )
71
- endif ()
72
- target_include_directories (ectool PRIVATE
73
- ../include/win32
74
- )
42
+ target_compile_definitions (ectool PRIVATE _CRT_SECURE_NO_WARNINGS )
43
+ target_link_libraries (ectool PRIVATE getopt CrosECDriver
44
+ onecoreuap_apiset.lib )
45
+ if (MSVC )
46
+ target_compile_options (ectool PRIVATE /FI "..\\ include\\ win32_shim.h" )
47
+ else ()
48
+ target_compile_options (ectool PRIVATE -include "..\\ include\\ win32_shim.h" )
49
+ endif ()
50
+ target_include_directories (ectool PRIVATE ../include/win32 )
75
51
endif ()
76
52
77
53
target_link_libraries (ectool ${libusb_LIBRARIES} ${libftdi1_LIBRARIES} )
78
54
79
-
80
55
# ============================
81
56
# Add Shared Library : libectool.so
82
57
# ============================
83
58
84
- set (LIBECTOOL_SOURCES ${ECTOOL_COMMON_SOURCES} ectool_fanctrl .cc )
59
+ set (LIBECTOOL_SOURCES ${ECTOOL_COMMON_SOURCES} ectool_wrapper .cc )
85
60
86
61
add_library (libectool SHARED ${LIBECTOOL_SOURCES} )
87
62
88
- target_include_directories (libectool PRIVATE
89
- ../include
90
- ${libusb_INCLUDE_DIRS}
91
- )
63
+ target_include_directories (libectool PRIVATE ../include ${libusb_INCLUDE_DIRS} )
92
64
93
- target_compile_definitions (libectool PRIVATE
94
- CHROMIUM_EC
95
- EXTERNAL_ECTOOL_BUILD
96
- )
65
+ target_compile_definitions (libectool PRIVATE CHROMIUM_EC EXTERNAL_ECTOOL_BUILD )
97
66
98
- target_compile_options (libectool PRIVATE
99
- -Wno-c99-designator
100
- -Wno-address-of-packed-member
101
- -Wno-format-security
102
- )
67
+ target_compile_options (
68
+ libectool PRIVATE -Wno-c99-designator -Wno-address-of-packed-member
69
+ -Wno-format-security )
103
70
104
- target_link_libraries (libectool PRIVATE
105
- ${libusb_LIBRARIES}
106
- ${libftdi1_LIBRARIES}
107
- )
71
+ target_link_libraries (libectool PRIVATE ${libusb_LIBRARIES}
72
+ ${libftdi1_LIBRARIES} )
108
73
109
74
if (WIN32 )
110
- target_compile_definitions (ectool PRIVATE
111
- _CRT_SECURE_NO_WARNINGS
112
- )
113
- target_link_libraries (ectool PRIVATE
114
- getopt
115
- CrosECDriver
116
- onecoreuap_apiset.lib
117
- )
118
- if (MSVC )
119
- target_compile_options (ectool PRIVATE
120
- /FI "..\\ include\\ win32_shim.h"
121
- )
122
- else ()
123
- target_compile_options (ectool PRIVATE
124
- -include "..\\ include\\ win32_shim.h"
125
- )
126
- endif ()
127
- target_include_directories (ectool PRIVATE
128
- ../include/win32
129
- )
75
+ target_compile_definitions (ectool PRIVATE _CRT_SECURE_NO_WARNINGS )
76
+ target_link_libraries (ectool PRIVATE getopt CrosECDriver
77
+ onecoreuap_apiset.lib )
78
+ if (MSVC )
79
+ target_compile_options (ectool PRIVATE /FI "..\\ include\\ win32_shim.h" )
80
+ else ()
81
+ target_compile_options (ectool PRIVATE -include "..\\ include\\ win32_shim.h" )
82
+ endif ()
83
+ target_include_directories (ectool PRIVATE ../include/win32 )
130
84
endif ()
131
85
132
- set_target_properties (libectool PROPERTIES
133
- OUTPUT_NAME "ectool" # Generates `libectool.so` or `libectool.dll`
86
+ set_target_properties (
87
+ libectool PROPERTIES OUTPUT_NAME "ectool" # Generates `libectool.so` or
88
+ # `libectool.dll`
134
89
)
135
-
0 commit comments