Skip to content

Commit

Permalink
Fix Linux linker flags
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Aug 19, 2023
1 parent 38b2f32 commit a590dd2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ target_link_libraries( weaponmod_amxx PRIVATE
# Remove "lib" prefix
set_target_properties( weaponmod_amxx PROPERTIES PREFIX "" )

if( NOT WIN32 )
if( MSVC )
# Export GiveFnptrsToDll
set( GAME_LINKER_FLAGS_PLAT "/EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1" )
else()
# Add _i386 suffix
set_target_properties( weaponmod_amxx PROPERTIES OUTPUT_NAME "weaponmod_amxx_i386" )
endif()

set_target_properties( weaponmod_amxx PROPERTIES
LINK_FLAGS "${GAME_LINKER_FLAGS} /EXPORT:GiveFnptrsToDll=_GiveFnptrsToDll@8,@1"
LINK_FLAGS "${GAME_LINKER_FLAGS} ${GAME_LINKER_FLAGS_PLAT}"
)

create_source_groups( "${CMAKE_SOURCE_DIR}" )
Expand Down

0 comments on commit a590dd2

Please sign in to comment.