From e2f8c7d989ab033389fe94f75e5dcd42f9415e67 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 29 Sep 2022 10:47:34 +0200 Subject: [PATCH] build: Enable PIC for romfs libraries --- plugins/builtin/CMakeLists.txt | 1 + plugins/windows/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/builtin/CMakeLists.txt b/plugins/builtin/CMakeLists.txt index fec4d1096..5248367e8 100644 --- a/plugins/builtin/CMakeLists.txt +++ b/plugins/builtin/CMakeLists.txt @@ -88,4 +88,5 @@ setupCompilerWarnings(${PROJECT_NAME}) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME ${PROJECT_NAME}) add_subdirectory(../../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs) +set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBROMFS_LIBRARY}) diff --git a/plugins/windows/CMakeLists.txt b/plugins/windows/CMakeLists.txt index 463ad1a2c..cf41e49cb 100644 --- a/plugins/windows/CMakeLists.txt +++ b/plugins/windows/CMakeLists.txt @@ -45,6 +45,7 @@ if (WIN32) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME ${PROJECT_NAME}) add_subdirectory(../../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs) + set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON) target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBROMFS_LIBRARY}) endif () \ No newline at end of file