mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-06 00:36:13 +08:00
msys2 : fix build
This commit is contained in:
@@ -52,6 +52,12 @@ target_link_libraries(ggwave-common PRIVATE
|
||||
${CMAKE_DL_LIBS}
|
||||
)
|
||||
|
||||
if (MINGW)
|
||||
target_link_libraries(ggwave-common PUBLIC
|
||||
stdc++
|
||||
)
|
||||
endif()
|
||||
|
||||
if (GGWAVE_SUPPORT_SDL2)
|
||||
# ggwave-common-sdl2
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ std::vector<char> readFile(const char* filename) {
|
||||
}
|
||||
|
||||
std::string getBinaryPath() {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#if defined(__EMSCRIPTEN__) || defined(_WIN32)
|
||||
return "";
|
||||
#endif
|
||||
#else
|
||||
std::string result;
|
||||
void* p = reinterpret_cast<void*>(dummy);
|
||||
|
||||
@@ -73,4 +73,5 @@ std::string getBinaryPath() {
|
||||
}
|
||||
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
7
examples/third-party/imgui/CMakeLists.txt
vendored
7
examples/third-party/imgui/CMakeLists.txt
vendored
@@ -31,6 +31,12 @@ target_link_libraries(imgui PRIVATE
|
||||
${ADDITIONAL_LIBRARIES}
|
||||
)
|
||||
|
||||
if (MINGW)
|
||||
target_link_libraries(imgui PUBLIC
|
||||
stdc++
|
||||
)
|
||||
endif()
|
||||
|
||||
if (GGWAVE_SUPPORT_SDL2)
|
||||
if (MINGW)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
@@ -57,7 +63,6 @@ if (GGWAVE_SUPPORT_SDL2)
|
||||
imgui
|
||||
opengl32
|
||||
${SDL2_LIBRARIES}
|
||||
stdc++
|
||||
)
|
||||
|
||||
target_link_libraries(imgui-sdl2 PRIVATE
|
||||
|
||||
@@ -21,3 +21,9 @@ if (BUILD_SHARED_LIBS)
|
||||
GGWAVE_SHARED
|
||||
)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
target_link_libraries(${TARGET} PUBLIC
|
||||
stdc++
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -30,7 +30,7 @@ int main() {
|
||||
ret = ggwave_encode(instance, payload, 4, GGWAVE_TX_PROTOCOL_AUDIBLE_FAST, 50, waveform, 0);
|
||||
CHECK(ret > 0);
|
||||
|
||||
ret = ggwave_decode(instance, waveform, sizeof(int16_t)*ret, decoded);
|
||||
ret = ggwave_decode(instance, waveform, sizeof(signed)*ret, decoded);
|
||||
CHECK(ret == 4);
|
||||
|
||||
CHECK(strcmp(decoded, payload) == 0);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <typeindex>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <cstdint>
|
||||
|
||||
float frand() { return float(rand()%RAND_MAX)/RAND_MAX; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user