cmake: remove SDL_STATIC_PIC cmake option.
Use CMAKE_POSITION_INDEPENDENT_CODE instead
This commit is contained in:
1 parent
4ce4fc575a
commit
dd0bb25f66
6 files changed
+16
-15
No files matched your search
@@ -306,6 +306,13 @@ if(WIN32)
|
||||
endif()
|
||||
```
|
||||
|
||||
### Linking against a static SDL library fails due to relocation errors
|
||||
|
||||
On unix platforms, all code that ends up in shared libraries needs to be built as relocatable (=position independent) code.
|
||||
However, by default CMake builds static libraries as non-relocatable.
|
||||
Configuring SDL with `-DCMAKE_POSITION_INDEPENDENT_CODE=ON` will result in a static `libSDL3.a` library
|
||||
which you can link against to create a shared library.
|
||||
|
||||
## Help, it doesn't work!
|
||||
|
||||
Below, a SDL3 CMake project can be found that builds 99.9% of time (assuming you have internet connectivity).
|
||||
|
||||
Reference in new issue
Block a user