2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-22 01:47:45 +01:00

Fix CMake build when included from other project

This commit is contained in:
Velaron 2021-10-12 14:26:22 +03:00 committed by a1batross
parent 060a6c3269
commit 219fb37f44
2 changed files with 2 additions and 4 deletions

View File

@ -27,7 +27,7 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0")
endif()
# Install custom module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(VSForceXPToolchain) # Force XP toolchain for Visual Studio
@ -52,8 +52,6 @@ set(SERVER_LIBRARY_NAME "hl" CACHE STRING "Library name for Linux/MacOS/Windows"
# MAIN BUILD CODE \
###################\
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT 64BIT)
if(MSVC)
error("UNDONE: set 32 build flags")

View File

@ -1,7 +1,7 @@
include(CheckSymbolExists)
# generated(see comments in public/build.h)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_SOURCE_DIR}/public/")
set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/")
check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT)
check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID)