mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 23:33:45 +02:00

CMake object libraries keep building with position-independent code enabled even when it's explicitly disabled! We do, in fact, have to build with position-independent code disabled on some targets, such as PlayStation Vita, since some targets support position-independent code. CMake static libraries don't seem to forcibly enable position-independent code, so I've converted all the object libraries into static libraries and added the new static libraries as dependencies in Meson.
21 lines
1,014 B
Diff
21 lines
1,014 B
Diff
# Prevents mpg123's build system from forcibly enabling position-independent code.
|
|
# Also removes the duplicate inclusion of compat_str.c. That causes duplicate symbol errors when linking mpg123 as whole archive.
|
|
|
|
--- a/ports/cmake/src/compat/CMakeLists.txt
|
|
+++ b/ports/cmake/src/compat/CMakeLists.txt
|
|
@@ -1,13 +1,7 @@
|
|
set(TARGET compat)
|
|
-add_library(${TARGET} OBJECT
|
|
+add_library(${TARGET} STATIC
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat.c"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat_str.c")
|
|
-set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
-add_library(${TARGET}_dl OBJECT
|
|
+add_library(${TARGET}_dl STATIC
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat_dl.c")
|
|
-set_target_properties(${TARGET}_dl PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
-
|
|
-add_library(${TARGET}_str OBJECT
|
|
- "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat_str.c")
|
|
-set_target_properties(${TARGET}_str PROPERTIES POSITION_INDEPENDENT_CODE ON)
|