Skip to content

Commit fbeb603

Browse files
committed
build: only build static converter on Win32
- macOS Clang seems to encounter the following error: ``` [ 3%] Linking CXX executable binary_to_compressed_c ld: library not found for -lcrt0.o clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` - Linux has no problem to run dynamically-linked converter. - Only Win32 with MinGW has problem running dynamically-linked one. So I only do polyfill for this.
1 parent 84d9219 commit fbeb603

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ make_directory (${GENERATED_WAVES_DIR})
7777

7878
# Binary-to-C converter from Dear ImGui
7979
add_executable (binary_to_compressed_c utils/binary_to_compressed_c.cpp)
80-
target_link_options (binary_to_compressed_c PRIVATE -static)
80+
# Only build static converter on Win32 or MinGW cross-compiling
81+
if (WIN32 AND NOT MSVC)
82+
target_link_options (binary_to_compressed_c PRIVATE -static)
83+
endif ()
8184

8285
set (WAVES_DIR ${PROJECT_SOURCE_DIR}/src/waves)
8386
set (GENERATED_WAVE_HEADER ${GENERATED_WAVES_DIR}/minaton_waves.hpp)

0 commit comments

Comments
 (0)