test: New SDL_TESTS_LINK_SHARED option for dynamically linked tests#15907
test: New SDL_TESTS_LINK_SHARED option for dynamically linked tests#15907Antonios-C wants to merge 1 commit into
Conversation
|
|
||
| if(NOT TARGET SDL2::SDL2-static) | ||
| find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test) | ||
| option(SDL_TESTS_SHARED_LIB "Link test executables against the shared SDL2 library" OFF) |
There was a problem hiding this comment.
SDL3 has SDL_TESTS_LINK_SHARED that serves the same purpose. Perhaps re-use this name?
There was a problem hiding this comment.
Oh didn't check SDL3. I'll reuse the name ! Will send revision
|
|
|
@sezero Not sure what you mean by "None of the functions even go though export/visibility stuff." can you elaborate ? From my experience, test executable should at least have the option to dynamically link with libraries. After all, that is a test within itself, "hey are the necessary libraries to run this binary present on the filesystem? " . |
Introduce SDL_TESTS_LINK_SHARED to allow tests that expect dynamic linking to be built. Signed-off-by: Antonios Christidis <a-christidis@ti.com>
9651241 to
0d864a7
Compare
It was a complete misunderstanding of the purpose of this patch on my part: Please ignore my remarks, and sorry for the noise. |
Introduce SDL_TESTS_LINK_SHARED to allow tests that expect dynamic linking to be built.
Description
When enabling tests to be built right now, they come with libsdl2 statically compiled within. Introduce a new configuration option SDL_TESTS_LINK_SHARED to allow users to specify if they want the test executable to expect to be linked dynamically to libsdl2.
Since tests have been being built by default with static libs since 2018 (6cf4d0e), the default will remain still that. Users need to go out of their way to enable SDL_TESTS_LINK_SHARED.