fix .so placement and loading paths

This commit is contained in:
2024-08-21 17:29:06 +03:00
parent e49d36a3b1
commit 1a34f6416b
4 changed files with 12 additions and 9 deletions

View File

@ -122,7 +122,8 @@ function(give_options target)
-ffp-contract=fast
-fno-signed-zeros
-fno-trapping-math
-freciprocal-math)
-freciprocal-math
-Wl,$<$<BOOL:${TOWNENGINE_HOT_RELOAD}>:-rpath ./>)
set(BUILD_FLAGS_RELEASE
-O3
@ -204,7 +205,12 @@ function(use_townengine target sources output_directory)
give_options(${target}_shared)
include_deps(${target}_shared)
target_link_libraries(${target}_shared PUBLIC SDL2::SDL2)
add_executable(${target} ${CMAKE_SOURCE_DIR}/townengine/null.c)
add_executable(${target} ${TOWNENGINE_DIR}/townengine/null.c)
set_target_properties(${target}_shared PROPERTIES
OUTPUT_NAME game
LIBRARY_OUTPUT_DIRECTORY ${output_directory})
set_target_properties(${TOWNENGINE_TARGET} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${output_directory})
else ()
add_executable(${target} ${sources})
endif ()