From 4e0d5bceb24042a6d31c76958ce2c6157369ac68 Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Tue, 19 Oct 2021 22:30:21 +0200 Subject: libc build fix, replaced dlerror() strings with enum --- libpsn00b/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libpsn00b/CMakeLists.txt') diff --git a/libpsn00b/CMakeLists.txt b/libpsn00b/CMakeLists.txt index bfe27c6..083208a 100644 --- a/libpsn00b/CMakeLists.txt +++ b/libpsn00b/CMakeLists.txt @@ -40,13 +40,19 @@ foreach(_library IN LISTS PSN00BSDK_LIBRARIES) psn00bsdk_add_library(${_library} STATIC ${_sources}) endforeach() -# Copy libgcc.a and merge the PSn00bSDK libc into it after building. +# Extract libgcc's contents and merge them into libc after building. +# Unfortunately glob expressions won't work on Windows, so we have to manually +# enumerate the contents of libgcc and save the list to a temporary file (as it +# is too long to be passed directly on the command line). This is actually the +# most reliable way I found to do this (I tried $ to no avail). add_custom_command( TARGET c POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PSN00BSDK_LIBGCC} $ + COMMAND ${CMAKE_AR} t ${PSN00BSDK_LIBGCC} $_libgcc.txt + COMMAND ${CMAKE_AR} x ${PSN00BSDK_LIBGCC} + COMMAND ${CMAKE_AR} q $ \@_libgcc.txt + COMMAND ${CMAKE_AR} s $ #COMMAND ${CMAKE_AR} rsuU $ *.o - COMMAND ${CMAKE_AR} rsuU $ $"," "> - COMMENT "Merging SDK libc contents into libgcc" + COMMENT "Merging libgcc contents into SDK libc" ) ## Installation -- cgit v1.2.3