aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/CMakeLists.txt
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-10-19 22:30:21 +0200
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-10-20 16:57:14 +0200
commit4e0d5bceb24042a6d31c76958ce2c6157369ac68 (patch)
tree20d3110363ab468e99502337c0a46852662bb365 /libpsn00b/CMakeLists.txt
parent7a2e6dd9550376f7a0511e73b33194170d712384 (diff)
downloadpsn00bsdk-4e0d5bceb24042a6d31c76958ce2c6157369ac68.tar.gz
libc build fix, replaced dlerror() strings with enum
Diffstat (limited to 'libpsn00b/CMakeLists.txt')
-rw-r--r--libpsn00b/CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
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 $<TARGET_OBJECTS> to no avail).
add_custom_command(
TARGET c POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${PSN00BSDK_LIBGCC} $<TARGET_FILE:c>
+ COMMAND ${CMAKE_AR} t ${PSN00BSDK_LIBGCC} $<ANGLE-R>_libgcc.txt
+ COMMAND ${CMAKE_AR} x ${PSN00BSDK_LIBGCC}
+ COMMAND ${CMAKE_AR} q $<TARGET_FILE:c> \@_libgcc.txt
+ COMMAND ${CMAKE_AR} s $<TARGET_FILE:c>
#COMMAND ${CMAKE_AR} rsuU $<TARGET_FILE:c> *.o
- COMMAND ${CMAKE_AR} rsuU $<TARGET_FILE:c> $<JOIN:"$<TARGET_OBJECTS:c>"," ">
- COMMENT "Merging SDK libc contents into libgcc"
+ COMMENT "Merging libgcc contents into SDK libc"
)
## Installation