Skip to content

Commit 3df9ab9

Browse files
committed
add win32 lib
disable build for linux
1 parent 314a68c commit 3df9ab9

File tree

19 files changed

+46
-17
lines changed

19 files changed

+46
-17
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ option (USE_LIBFTDI "USE_LIBFTDI" OFF)
2525
option (USE_OPENMP "USE_OPENMP" OFF)
2626
option (WARNINGS_AS_ERRORS "WARNINGS_AS_ERRORS" OFF)
2727
option (BUILD_OYMOTION_SDK "BUILD_OYMOTION_SDK" OFF)
28-
option (BUILD_SYNCHRONI_SDK "BUILD_SYNCHRONI_SDK" ON)
28+
option (BUILD_SYNCHRONI_SDK "BUILD_SYNCHRONI_SDK" OFF)
2929
option (BUILD_BLUETOOTH "BUILD_BLUETOOTH" OFF)
3030
option (BUILD_BLE "BUILD_BLE" OFF)
3131
option (BUILD_ONNX "BUILD_ONNX" OFF)

third_party/synchroni/build.cmake

+34-11
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
99
else ()
1010
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME "SynchroniLib.dll")
1111
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME_DOT_LIB "SynchroniLib.lib")
12+
SET (SYNCHRONI_SDK_LINK_NAME_LIB "sensor")
13+
SET (SYNCHRONI_SDK_LINK_NAME_DOT_LIB "sensor.lib")
14+
SET (SYNCHRONI_SDK_ARCH "Win64")
1215
endif (APPLE)
1316
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
1417
if (APPLE)
1518
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME "libSynchroniLib.dylib")
1619
elseif (UNIX)
1720
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME "libSynchroniLib.so")
1821
else ()
22+
SET (SYNCHRONI_SDK_WRAPPER_NAME "SynchroniLib32")
1923
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME "SynchroniLib32.dll")
2024
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME_DOT_LIB "SynchroniLib32.lib")
25+
SET (SYNCHRONI_SDK_LINK_NAME_LIB "sensor32")
26+
SET (SYNCHRONI_SDK_LINK_NAME_DOT_LIB "sensor32.lib")
27+
SET (SYNCHRONI_SDK_ARCH "Win32")
2128
endif (APPLE)
2229
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
2330

@@ -36,9 +43,9 @@ add_library (
3643
if (APPLE)
3744
target_link_libraries (${SYNCHRONI_SDK_WRAPPER_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/mac/sensor.xcframework)
3845
elseif (UNIX)
39-
SET (SYNCHRONI_SDK_WRAPPER_COMPILED_NAME "libSynchroniLib.so")
46+
target_link_libraries (${SYNCHRONI_SDK_WRAPPER_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/linux/x86_64/For$<CONFIG>/libsensor.so)
4047
else ()
41-
target_link_libraries (${SYNCHRONI_SDK_WRAPPER_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/For$<CONFIG>/sensor.lib)
48+
target_link_libraries (${SYNCHRONI_SDK_WRAPPER_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_DOT_LIB})
4249
endif (APPLE)
4350

4451

@@ -72,13 +79,13 @@ if (MSVC)
7279
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${SYNCHRONI_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_NAME}.dll"
7380
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${SYNCHRONI_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/nodejs_package/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_NAME}.dll"
7481
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${SYNCHRONI_SDK_WRAPPER_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_NAME}.dll"
75-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
76-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
77-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
78-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${SYNCHRONI_SDK_NAME}.dll"
79-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
80-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/nodejs_package/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
81-
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/For$<CONFIG>/${SYNCHRONI_SDK_NAME}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${SYNCHRONI_SDK_NAME}.dll"
82+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
83+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
84+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
85+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
86+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
87+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/nodejs_package/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
88+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll"
8289
)
8390
endif (MSVC)
8491

@@ -91,6 +98,13 @@ if (UNIX)
9198
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}"
9299
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}"
93100
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/compiled/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}"
101+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/matlab_package/brainflow/lib/libsensor.so"
102+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/python_package/brainflow/lib/libsensor.so"
103+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/csharp_package/brainflow/brainflow/lib/libsensor.so"
104+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/java_package/brainflow/src/main/resources/libsensor.so"
105+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/julia_package/brainflow/lib/libsensor.so"
106+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/nodejs_package/brainflow/lib/libsensor.so"
107+
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${CMAKE_CURRENT_LIST_DIR}/lib/linux/x86_64/For$<CONFIG>/libsensor.so" "${CMAKE_CURRENT_SOURCE_DIR}/rust_package/brainflow/lib/libsensor.so"
94108
)
95109
endif (UNIX)
96110

@@ -99,19 +113,28 @@ if (MSVC)
99113
install (
100114
FILES
101115
${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/SynchroniLib.dll
102-
${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/For$<CONFIG>/sensor.dll
116+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll
103117
DESTINATION lib
104118
)
105119
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
106120
install (
107121
FILES
108122
${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/SynchroniLib32.dll
109-
${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/For$<CONFIG>/sensor32.dll
123+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/windows/${SYNCHRONI_SDK_ARCH}/For$<CONFIG>/${SYNCHRONI_SDK_LINK_NAME_LIB}.dll
110124
DESTINATION lib
111125
)
112126
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
113127
endif (MSVC)
114128

129+
if (UNIX)
130+
install (
131+
FILES
132+
${CMAKE_CURRENT_SOURCE_DIR}/compiled/$<CONFIG>/${SYNCHRONI_SDK_WRAPPER_COMPILED_NAME}
133+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/synchroni/lib/linux/x86_64/For$<CONFIG>/libsensor.so
134+
DESTINATION lib
135+
)
136+
endif(UNIX)
137+
115138
install (
116139
TARGETS ${SYNCHRONI_SDK_WRAPPER_NAME}
117140
EXPORT ${TARGETS_EXPORT_NAME}

third_party/synchroni/inc/SensorProfile.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <memory>
66
#include <functional>
77
#include <mutex>
8-
#include "sensorData.hpp"
8+
#include "SensorData.hpp"
99

1010
namespace sensor {
1111

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

tools/build.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ def prepare_args():
136136
parser.add_argument(
137137
'--no-oymotion', dest='oymotion', action='store_false')
138138
parser.set_defaults(oymotion=False)
139+
140+
parser.add_argument('--synchroni', dest='synchroni', action='store_true')
141+
parser.add_argument('--no-synchroni', dest='synchroni', action='store_false')
142+
parser.set_defaults(synchroni='store_false')
143+
139144
parser.add_argument('--msvc-runtime', type=str, choices=[
140145
'static', 'dynamic'],
141146
help='how to link MSVC runtime', required=False, default='static')
@@ -180,6 +185,11 @@ def prepare_args():
180185
parser.add_argument('--cmake-osx-deployment-target', type=str,
181186
help='min supported version of osx', required=False, default='10.15')
182187
parser.add_argument('--use-libftdi', action='store_true')
188+
189+
parser.add_argument('--synchroni', dest='synchroni', action='store_true')
190+
parser.add_argument('--no-synchroni', dest='synchroni', action='store_false')
191+
parser.set_defaults(synchroni='store_false')
192+
183193
try:
184194
output = subprocess.check_output(['ninja', '--version'])
185195
print(output)
@@ -216,10 +226,6 @@ def prepare_args():
216226
parser.add_argument('--no-ble', dest='ble', action='store_false')
217227
parser.set_defaults(ble=ble_default)
218228

219-
parser.add_argument('--synchroni', dest='synchroni', action='store_true')
220-
parser.add_argument('--no-synchroni', dest='synchroni', action='store_false')
221-
parser.set_defaults(synchroni='store_false')
222-
223229
parser.add_argument('--tests', dest='tests', action='store_true')
224230
parser.add_argument('--no-tests', dest='tests', action='store_false')
225231
parser.set_defaults(tests=tests_default)

0 commit comments

Comments
 (0)