mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-25 08:13:44 +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.
33 lines
1.3 KiB
Diff
33 lines
1.3 KiB
Diff
# Prevents OpenAL Soft's build system from forcibly enabling position-independent code.
|
|
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -1377,7 +1377,7 @@ target_compile_definitions(alsoft.common PRIVATE ${CPP_DEFS})
|
|
target_compile_options(alsoft.common PRIVATE ${C_FLAGS})
|
|
target_link_libraries(alsoft.common PRIVATE alsoft::fmt)
|
|
set_target_properties(alsoft.common PROPERTIES ${ALSOFT_STD_VERSION_PROPS}
|
|
- POSITION_INDEPENDENT_CODE TRUE)
|
|
+ )
|
|
|
|
|
|
unset(HAS_ROUTER)
|
|
--- a/fmt-11.1.1/CMakeLists.txt
|
|
+++ b/fmt-11.1.1/CMakeLists.txt
|
|
@@ -58,7 +58,7 @@ add_headers(FMT_HEADERS args.h base.h chrono.h color.h compile.h core.h format.h
|
|
xchar.h)
|
|
set(FMT_SOURCES src/format.cc src/os.cc)
|
|
|
|
-add_library(alsoft.fmt OBJECT ${FMT_SOURCES} ${FMT_HEADERS} README.md ChangeLog.md)
|
|
+add_library(alsoft.fmt STATIC ${FMT_SOURCES} ${FMT_HEADERS} README.md ChangeLog.md)
|
|
add_library(alsoft::fmt ALIAS alsoft.fmt)
|
|
|
|
if (cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
|
@@ -73,7 +73,7 @@ target_include_directories(alsoft.fmt PUBLIC
|
|
set_target_properties(alsoft.fmt PROPERTIES ${ALSOFT_STD_VERSION_PROPS}
|
|
VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
|
|
DEBUG_POSTFIX "${ALSOFT_FMT_DEBUG_POSTFIX}"
|
|
- POSITION_INDEPENDENT_CODE TRUE
|
|
+
|
|
C_VISIBILITY_PRESET hidden
|
|
CXX_VISIBILITY_PRESET hidden
|
|
EXCLUDE_FROM_ALL TRUE)
|