msys2 : fix build

This commit is contained in:
Georgi Gerganov
2021-02-27 09:47:13 -08:00
parent 8a930b7a96
commit 5f2bfd09ba
6 changed files with 23 additions and 4 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -21,3 +21,9 @@ if (BUILD_SHARED_LIBS)
GGWAVE_SHARED
)
endif()
if (MINGW)
target_link_libraries(${TARGET} PUBLIC
stdc++
)
endif()

View File

@@ -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);

View File

@@ -7,6 +7,7 @@
#include <typeindex>
#include <vector>
#include <set>
#include <cstdint>
float frand() { return float(rand()%RAND_MAX)/RAND_MAX; }