Revert "cmake: force to use library naming scheme."

This reverts commit b89ce4c527.
This commit is contained in:
Andrey Akhmichin 2023-12-21 21:47:02 +05:00
parent b89ce4c527
commit 2f13985e23
3 changed files with 16 additions and 12 deletions

View File

@ -36,10 +36,6 @@ include(VSForceXPToolchain) # Force XP toolchain for Visual Studio
project (HLSDK-PORTABLE) project (HLSDK-PORTABLE)
# Xash3D FWGS Library Naming Scheme compliance
# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/extensions/library-naming.md
include(LibraryNaming)
#-------------- #--------------
# USER DEFINES \ # USER DEFINES \
################\ ################\
@ -51,13 +47,17 @@ option(USE_VOICEMGR "Enable VOICE MANAGER." OFF)
option(BUILD_CLIENT "Build client dll" ON) option(BUILD_CLIENT "Build client dll" ON)
option(BUILD_SERVER "Build server dll" ON) option(BUILD_SERVER "Build server dll" ON)
if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((XASH_WIN32 OR XASH_LINUX) AND XASH_AMD64)) if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR
((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64"
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64"
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")))
option(64BIT "Disable auto -m32 appending to compiler flags" OFF) option(64BIT "Disable auto -m32 appending to compiler flags" OFF)
else() else()
option(64BIT "Disable auto -m32 appending to compiler flags" ON) option(64BIT "Disable auto -m32 appending to compiler flags" ON)
endif() endif()
if ((XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) AND ((XASH_AMD64 AND NOT 64BIT) OR XASH_X86)) if ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR APPLE) AND NOT 64BIT)
option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" ON) option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" ON)
else() else()
option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF)
@ -109,6 +109,10 @@ if(64BIT AND CMAKE_SIZEOF_VOID_P EQUAL 4)
message(FATAL_ERROR "You enabled XASH_64BIT, but compiler can't create 64 bit code!") message(FATAL_ERROR "You enabled XASH_64BIT, but compiler can't create 64 bit code!")
endif() endif()
# Xash3D FWGS Library Naming Scheme compliance
# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/extensions/library-naming.md
include(LibraryNaming)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Building for 64 Bit") message(STATUS "Building for 64 Bit")
else() else()
@ -127,7 +131,7 @@ else()
add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H) add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H)
endif() endif()
if(XASH_PSVITA) if(VITA)
add_compile_options(-fno-use-cxa-atexit) add_compile_options(-fno-use-cxa-atexit)
endif() endif()

View File

@ -175,19 +175,19 @@ if (GOLDSOURCE_SUPPORT)
endif() endif()
if (USE_VGUI) if (USE_VGUI)
if (XASH_WIN32) if (WIN32)
add_library(vgui SHARED IMPORTED) add_library(vgui SHARED IMPORTED)
set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.dll") set_property(TARGET vgui PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.dll")
set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.lib") set_property(TARGET vgui PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib/win32_vc6/vgui.lib")
target_link_libraries(${CLDLL_LIBRARY} vgui) target_link_libraries(${CLDLL_LIBRARY} vgui)
elseif(XASH_APPLE) elseif(APPLE)
target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib vgui.dylib") target_link_libraries(${CLDLL_LIBRARY} "-Wl,--no-undefined -L${CMAKE_SOURCE_DIR}/vgui_support/vgui-dev/lib vgui.dylib")
else() else()
target_link_libraries(${CLDLL_LIBRARY} :vgui.so) target_link_libraries(${CLDLL_LIBRARY} :vgui.so)
endif() endif()
endif() endif()
if(XASH_WIN32) if(WIN32)
target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) target_link_libraries( ${CLDLL_LIBRARY} user32.lib )
if (GOLDSOURCE_SUPPORT) if (GOLDSOURCE_SUPPORT)
target_link_libraries( ${CLDLL_LIBRARY} winmm.lib ) target_link_libraries( ${CLDLL_LIBRARY} winmm.lib )
@ -197,7 +197,7 @@ endif()
set_target_properties (${CLDLL_LIBRARY} PROPERTIES set_target_properties (${CLDLL_LIBRARY} PROPERTIES
POSITION_INDEPENDENT_CODE 1) POSITION_INDEPENDENT_CODE 1)
if(NOT XASH_ANDROID) if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(CLDLL_NAME "client") set(CLDLL_NAME "client")
set_target_properties(${CLDLL_LIBRARY} PROPERTIES set_target_properties(${CLDLL_LIBRARY} PROPERTIES
OUTPUT_NAME ${CLDLL_NAME} OUTPUT_NAME ${CLDLL_NAME}

View File

@ -161,7 +161,7 @@ add_library (${SVDLL_LIBRARY} SHARED ${SVDLL_SOURCES})
set_target_properties (${SVDLL_LIBRARY} PROPERTIES set_target_properties (${SVDLL_LIBRARY} PROPERTIES
POSITION_INDEPENDENT_CODE 1) POSITION_INDEPENDENT_CODE 1)
if(NOT XASH_ANDROID) if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(SVDLL_NAME "${SERVER_LIBRARY_NAME}") set(SVDLL_NAME "${SERVER_LIBRARY_NAME}")
set_target_properties(${SVDLL_LIBRARY} PROPERTIES set_target_properties(${SVDLL_LIBRARY} PROPERTIES