Browse Source

Merge branch 'master' into residual_point

residual_point
Andrey Akhmichin 2 years ago
parent
commit
66aa4a6899
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
  1. 88
      CMakeLists.txt
  2. 10
      cl_dll/CMakeLists.txt
  3. 8
      dlls/CMakeLists.txt

88
CMakeLists.txt

@ -29,6 +29,8 @@ endif()
# Install custom module path # Install custom module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(CheckIncludeFile)
include(CheckCSourceCompiles)
include(VSForceXPToolchain) # Force XP toolchain for Visual Studio include(VSForceXPToolchain) # Force XP toolchain for Visual Studio
project (HLSDK-XASH3D) project (HLSDK-XASH3D)
@ -55,15 +57,39 @@ else()
option(64BIT "Disable auto -m32 appending to compiler flags" ON) option(64BIT "Disable auto -m32 appending to compiler flags" ON)
endif() endif()
set(GAMEDIR "valve" CACHE STRING "Gamedir path") option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" ON)
set(SERVER_INSTALL_DIR "dlls" CACHE STRING "Where put server dll") option(CLIENT_WEAPONS "Enable client local weapons prediction" ON)
option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" ON)
option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" ON)
option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" ON)
option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" ON)
option(OEM_BUILD "Enable OEM Build" OFF)
option(HLDEMO_BUILD "Enable Demo Build" OFF)
option(RLIFE "Compile as Residual Life" ON)
set(GAMEDIR "ResidualPoint" CACHE STRING "Gamedir path")
set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll") set(CLIENT_INSTALL_DIR "cl_dlls" CACHE STRING "Where put client dll")
set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for PC platforms")
# Residual Point and Residual Life has the same game logic, so there no real difference.
# And Residual Life 2.0.1+ includes all an old Residual Point maps.
if(RLIFE)
set(GAMEDIR "ResidualLife" CACHE STRING "Gamedir path")
set(SERVER_LIBRARY_NAME "rl" CACHE STRING "Library name for PC platforms")
message(STATUS "Residual Life")
else()
set(GAMEDIR "ResidualPoint" CACHE STRING "Gamedir path")
set(SERVER_LIBRARY_NAME "rp" CACHE STRING "Library name for PC platforms")
message(STATUS "Residual Point")
endif()
#----------------- #-----------------
# MAIN BUILD CODE \ # MAIN BUILD CODE \
###################\ ###################\
if(HLDEMO_BUILD AND OEM_BUILD)
message(FATAL_ERROR "Don't mix Demo and OEM builds!")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT) if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT)
if(MSVC) if(MSVC)
error("UNDONE: set 32 build flags") error("UNDONE: set 32 build flags")
@ -89,6 +115,46 @@ else()
message(STATUS "Building for 32 Bit") message(STATUS "Building for 32 Bit")
endif() endif()
if(CLIENT_WEAPONS)
message(STATUS "Client weapons enabled.")
add_definitions(-DCLIENT_WEAPONS)
endif()
if(BARNACLE_FIX_VISIBILITY)
message(STATUS "Barnacle tongue fix enabled")
add_definitions(-DBARNACLE_FIX_VISIBILITY)
endif()
if(CROWBAR_IDLE_ANIM)
message(STATUS "Crowbar idle animation enabled")
add_definitions(-DCROWBAR_IDLE_ANIM)
endif()
if(CROWBAR_DELAY_FIX)
message(STATUS "Crowbar attack delay fix enabled")
add_definitions(-DCROWBAR_DELAY_FIX)
endif()
if(CROWBAR_FIX_RAPID_CROWBAR)
message(STATUS "Rapid crowbar fix enabled")
add_definitions(-DCROWBAR_FIX_RAPID_CROWBAR)
endif()
if(GAUSS_OVERCHARGE_FIX)
message(STATUS "Gauss overcharge fix enabled")
add_definitions(-DGAUSS_OVERCHARGE_FIX)
endif()
if(OEM_BUILD)
message(STATUS "OEM build enabled")
add_definitions(-DOEM_BUILD)
endif()
if(HLDEMO_BUILD)
message(STATUS "Demo build enabled")
add_definitions(-DHLDEMO_BUILD)
endif()
if (MINGW) if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--add-stdcall-alias")
@ -111,15 +177,29 @@ else()
add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H) add_definitions(-D_CRT_SILENCE_NONCONFORMING_TGMATH_H)
endif() endif()
check_include_file("tgmath.h" HAVE_TGMATH_H)
if(HAVE_TGMATH_H)
if(NOT MSVC)
set(CMAKE_REQUIRED_LIBRARIES "m")
endif()
check_c_source_compiles("#include <tgmath.h>
const float val = 2, val2 = 3;
int main(){ return (int)(-asin(val) + cos(val2)); }" HAVE_VALID_TGMATH_H )
if(${HAVE_VALID_TGMATH_H})
add_definitions(-DHAVE_TGMATH_H)
endif()
endif()
if(BUILD_CLIENT) if(BUILD_CLIENT)
message(STATUS "Building client enabled")
add_subdirectory(cl_dll) add_subdirectory(cl_dll)
endif() endif()
if(BUILD_SERVER) if(BUILD_SERVER)
message(STATUS "Building server enabled")
add_subdirectory(dlls) add_subdirectory(dlls)
endif() endif()
if(NOT BUILD_SERVER AND NOT BUILD_CLIENT) if(NOT BUILD_SERVER AND NOT BUILD_CLIENT)
error("Nothing to build") message(FATAL_ERROR "Nothing to build")
endif() endif()

10
cl_dll/CMakeLists.txt

@ -25,13 +25,7 @@ project (CLDLL)
set (CLDLL_LIBRARY client) set (CLDLL_LIBRARY client)
include(CheckIncludeFile) add_definitions(-DCLIENT_DLL)
check_include_file("tgmath.h" HAVE_TGMATH_H)
if(HAVE_TGMATH_H)
add_definitions(-DHAVE_TGMATH_H)
endif()
add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL -DCROWBAR_IDLE_ANIM)
if(NOT MSVC) if(NOT MSVC)
add_compile_options(-fno-exceptions) # GCC/Clang flag add_compile_options(-fno-exceptions) # GCC/Clang flag
@ -204,7 +198,7 @@ endif()
set_target_properties (${CLDLL_LIBRARY} PROPERTIES set_target_properties (${CLDLL_LIBRARY} PROPERTIES
POSITION_INDEPENDENT_CODE 1) POSITION_INDEPENDENT_CODE 1)
if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 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}

8
dlls/CMakeLists.txt

@ -25,14 +25,6 @@ project (SVDLL)
set (SVDLL_LIBRARY server) set (SVDLL_LIBRARY server)
include(CheckIncludeFile)
check_include_file("tgmath.h" HAVE_TGMATH_H)
if(HAVE_TGMATH_H)
add_definitions(-DHAVE_TGMATH_H)
endif()
add_definitions(-DCLIENT_WEAPONS -DCROWBAR_IDLE_ANIM)
if(NOT MSVC) if(NOT MSVC)
add_compile_options(-fno-exceptions) # GCC/Clang flag add_compile_options(-fno-exceptions) # GCC/Clang flag
add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag

Loading…
Cancel
Save