cmake: Don't set POSITION_INDEPENDENT_CODE on PS Vita

VitaSDK linker does not support PIC.
This commit is contained in:
Sebastian Krzyszkowiak 2021-07-22 16:46:06 +02:00
parent 30022f1c5c
commit e74d01f671
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -19,29 +19,35 @@ endif()
if (LIBSUPERDERPY_EMBEDDED_ALLEGRO)
option(SHARED "Build embedded Allegro as a shared library" OFF) # Allegro doesn't namespace this...
add_subdirectory("3rdparty/allegro5" EXCLUDE_FROM_ALL)
set_property(TARGET "allegro" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_font" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_ttf" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_primitives" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_audio" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_acodec" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_image" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_color" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_video" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_main" PROPERTY POSITION_INDEPENDENT_CODE ON)
if (NOT VITA)
set_property(TARGET "allegro" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_font" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_ttf" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_primitives" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_audio" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_acodec" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_image" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_color" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_video" PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET "allegro_main" PROPERTY POSITION_INDEPENDENT_CODE ON)
endif (NOT VITA)
endif (LIBSUPERDERPY_EMBEDDED_ALLEGRO)
if (LIBSUPERDERPY_IMGUI)
set(IMGUI_STATIC ON CACHE STRING "" FORCE)
add_subdirectory(3rdparty/cimgui EXCLUDE_FROM_ALL)
set_property(TARGET "cimgui" PROPERTY POSITION_INDEPENDENT_CODE ON)
if (NOT VITA)
set_property(TARGET "cimgui" PROPERTY POSITION_INDEPENDENT_CODE ON)
endif (NOT VITA)
list(APPEND SRC_LIST imgui/imgui_impl_allegro5.c)
endif (LIBSUPERDERPY_IMGUI)
if (LIBSUPERDERPY_STATIC)
add_library("libsuperderpy" STATIC ${SRC_LIST})
set_property(TARGET "libsuperderpy" PROPERTY POSITION_INDEPENDENT_CODE ON)
if (NOT VITA)
set_property(TARGET "libsuperderpy" PROPERTY POSITION_INDEPENDENT_CODE ON)
endif (NOT VITA)
else (LIBSUPERDERPY_STATIC)
add_library("libsuperderpy" SHARED ${SRC_LIST})
endif (LIBSUPERDERPY_STATIC)