Skip to content

Commit 74f35eb

Browse files
committed
waver : fix font loading and snap build
1 parent 770e464 commit 74f35eb

File tree

8 files changed

+36
-25
lines changed

8 files changed

+36
-25
lines changed

CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,3 @@ endif()
9898
if (GGWAVE_BUILD_EXAMPLES)
9999
add_subdirectory(examples)
100100
endif()
101-
102-
install(TARGETS ggwave RUNTIME)
103-
install(TARGETS ggwave-common RUNTIME)
104-
install(TARGETS ggsock RUNTIME)
105-
106-
if (GGWAVE_SUPPORT_SDL2)
107-
install(TARGETS ggwave-common-sdl2 RUNTIME)
108-
install(TARGETS imgui RUNTIME)
109-
install(TARGETS imgui-sdl2 RUNTIME)
110-
install(TARGETS waver RUNTIME)
111-
112-
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/DroidSans.ttf DESTINATION bin)
113-
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/fontawesome-webfont.ttf DESTINATION bin)
114-
endif()

examples/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,9 @@ if (GGWAVE_SUPPORT_SDL2)
9999
add_subdirectory(waver)
100100
add_subdirectory(spectrogram)
101101
endif()
102+
103+
install(TARGETS ggwave-common LIBRARY DESTINATION lib)
104+
105+
if (GGWAVE_SUPPORT_SDL2)
106+
install(TARGETS ggwave-common-sdl2 LIBRARY DESTINATION lib)
107+
endif()

examples/third-party/ggsock

examples/third-party/imgui/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,9 @@ if (GGWAVE_SUPPORT_SDL2)
123123
)
124124
endif()
125125
endif()
126+
127+
install(TARGETS imgui LIBRARY DESTINATION lib)
128+
129+
if (GGWAVE_SUPPORT_SDL2)
130+
install(TARGETS imgui-sdl2 LIBRARY DESTINATION lib)
131+
endif()

examples/waver/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@ else()
4343
imgui-sdl2
4444
${CMAKE_THREAD_LIBS_INIT}
4545
)
46+
47+
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/DroidSans.ttf DESTINATION bin)
48+
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/fontawesome-webfont.ttf DESTINATION bin)
4649
endif()
50+
51+
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)

examples/waver/main.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,21 @@ int main(int argc, char** argv) {
229229
ImGui_Init(window, gl_context);
230230
ImGui::GetIO().IniFilename = nullptr;
231231

232-
ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
233-
ImGui_tryLoadFont(getBinaryPath() + "../bin/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
234-
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
235-
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
236-
237-
ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
238-
ImGui_tryLoadFont(getBinaryPath() + "../bin/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
239-
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
240-
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
232+
{
233+
bool isNotLoaded = true;
234+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
235+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../bin/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
236+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
237+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
238+
}
239+
240+
{
241+
bool isNotLoaded = true;
242+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
243+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../bin/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
244+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
245+
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
246+
}
241247

242248
ImGui_SetStyle();
243249

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
source: https://github.com/ggerganov/ggwave
4747
source-type: git
4848
plugin: cmake
49-
configflags: [-DBUILD_SHARED_LIBS=OFF]
49+
#configflags: [-DBUILD_SHARED_LIBS=OFF]
5050
build-packages:
5151
- g++
5252
- make

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ if (MINGW)
2727
stdc++
2828
)
2929
endif()
30+
31+
install(TARGETS ${TARGET} LIBRARY DESTINATION lib)

0 commit comments

Comments
 (0)