mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-15 09:18:27 +00:00
cmake: don't create relocatable packages by default with non-MSVC toolchains
This commit is contained in:
parent
af3d97dcac
commit
df1f1c2e12
3 changed files with 22 additions and 10 deletions
|
@ -172,6 +172,11 @@ if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS)
|
|||
set(SDL_SYSTEM_ICONV_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
set(SDL_RELOCATABLE_DEFAULT OFF)
|
||||
if(MSVC)
|
||||
set(SDL_RELOCATABLE_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(NOT SDL_LIBC)
|
||||
# Make sure /RTC1 is disabled, otherwise it will use functions from the CRT
|
||||
|
@ -282,6 +287,7 @@ cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive usi
|
|||
cmake_dependent_option(SDL_DISABLE_INSTALL_DOCS "Install docs for SDL3" ON "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK" ON)
|
||||
set_option(SDL_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF)
|
||||
cmake_dependent_option(SDL_PRESEED "Preseed CMake cache to speed up configuration" ON "${SDL_PRESEED_AVAILABLE}" OFF)
|
||||
cmake_dependent_option(SDL_RELOCATABLE "Create relocatable SDL package" ${SDL_RELOCATABLE_DEFAULT} "NOT SDL_DISABLE_INSTALL" OFF)
|
||||
|
||||
cmake_dependent_option(SDL_DISABLE_ANDROID_JAR "Disable creation of SDL3.jar" ${SDL3_SUBPROJECT} "ANDROID" ON)
|
||||
|
||||
|
|
|
@ -36,9 +36,10 @@
|
|||
"-DSDL_SHARED=ON",
|
||||
"-DSDL_STATIC=OFF",
|
||||
"-DSDL_DISABLE_INSTALL_DOCS=ON",
|
||||
"-DSDL_RELOCATABLE=ON",
|
||||
"-DSDL_TEST_LIBRARY=ON",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org",
|
||||
"-DSDL_TESTS=OFF"
|
||||
"-DSDL_TESTS=OFF",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org"
|
||||
],
|
||||
"shared-static": "args"
|
||||
},
|
||||
|
@ -100,6 +101,7 @@
|
|||
"-DSDL_TEST_LIBRARY=ON",
|
||||
"-DSDL_TESTS=OFF",
|
||||
"-DSDL_DISABLE_INSTALL_DOCS=ON",
|
||||
"-DSDL_RELOCATABLE=ON",
|
||||
"-DSDL_VENDOR_INFO=libsdl.org"
|
||||
],
|
||||
"files-lib": {
|
||||
|
|
|
@ -338,6 +338,7 @@ function(configure_sdl3_pc)
|
|||
message(STATUS "\"pkg-config --static --libs sdl3\" will return invalid information")
|
||||
endif()
|
||||
|
||||
if(SDL_RELOCATABLE)
|
||||
# Calculate prefix relative to location of sdl3.pc
|
||||
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
|
||||
|
@ -345,6 +346,9 @@ function(configure_sdl3_pc)
|
|||
file(RELATIVE_PATH SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/${SDL_PKGCONFIG_INSTALLDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
string(REGEX REPLACE "[/]+$" "" SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG "${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
set(SDL_PKGCONFIG_PREFIX "\${pcfiledir}/${SDL_PATH_PREFIX_RELATIVE_TO_PKGCONFIG}")
|
||||
else()
|
||||
set(SDL_PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
endif()
|
||||
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(INCLUDEDIR_FOR_PKG_CONFIG "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue