File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,8 @@ set(CMAKE_CXX_STANDARD 14)
13
13
set (CMAKE_CXX_STANDARD_REQUIRED ON )
14
14
set (CMAKE_CXX_EXTENSIONS OFF )
15
15
16
- # Need fPIC when compiling a shared library (e.g. libretro.so)
17
16
# Must be at global scope, otherwise breaks -DPLAYER_BUILD_LIBLCF (see CMP0077)
18
17
option (BUILD_SHARED_LIBS "Build shared easyrpg_libretro core" ON )
19
- if (BUILD_SHARED_LIBS )
20
- set (CMAKE_POSITION_INDEPENDENT_CODE ON )
21
- endif ()
22
18
23
19
# Source Files
24
20
add_library (${PROJECT_NAME} STATIC
@@ -438,6 +434,12 @@ else()
438
434
message (FATAL_ERROR "Invalid target platform" )
439
435
endif ()
440
436
437
+ if (NOT PLAYER_BUILD_EXECUTABLE AND BUILD_SHARED_LIBS )
438
+ # Need fPIC when compiling a shared library (e.g. libretro.so)
439
+ set (CMAKE_POSITION_INDEPENDENT_CODE ON )
440
+ set_property (TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON )
441
+ endif ()
442
+
441
443
if (WIN32 )
442
444
target_sources (${PROJECT_NAME} PRIVATE
443
445
src/registry.cpp
@@ -788,6 +790,7 @@ else()
788
790
src/platform/libretro/libretro_ui.cpp
789
791
src/platform/libretro/libretro_ui.h)
790
792
target_link_libraries (easyrpg_libretro ${PROJECT_NAME} )
793
+ set_target_properties (easyrpg_libretro PROPERTIES PREFIX "" )
791
794
else ()
792
795
message (FATAL_ERROR "Unsupported library target platform ${PLAYER_TARGET_PLATFORM} " )
793
796
endif ()
You can’t perform that action at this time.
0 commit comments