Skip to content

Add support for compiling against the sdk2013 branch #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 4, 2017
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Set(SOURCEPYTHON_KEYVALUES_MODULE_HEADERS

Set(SOURCEPYTHON_KEYVALUES_MODULE_SOURCES
core/modules/keyvalues/keyvalues_wrap.cpp
${SOURCESDK}/tier1/KeyValues.cpp
${SOURCESDK}/public/tier1/KeyValues.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That line could be removed completely as it gets included in shared.make.

)

# ------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/core/modules/keyvalues/keyvalues_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void export_keyvalues(scope _keyvalues)

.add_property("next_key",
make_function(
&KeyValues::GetNextKey,
GET_METHOD(KeyValues *, KeyValues, GetNextKey, void),
reference_existing_object_policy()
),
&KeyValues::SetNextKey,
Expand Down
5 changes: 4 additions & 1 deletion src/makefiles/branch/sdk2013.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
# Purpose: This is the CMake file for the sdk2013 branch.
# ------------------------------------------------------------------

Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-DINTERFACEVERSION_SERVERGAMEDLL=\"ServerGameDLL010\"")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a note that these two lines should be removed once the SDK has been updated:
https://github.com/alliedmodders/hl2sdk/blob/3957adff10fe20d38a62fa8c018340bf2618742b/public/eiface.h#L459-L467

# ------------------------------------------------------------------
# Set the engine version.
# ------------------------------------------------------------------
Set(SOURCE_ENGINE "sdk2013")
add_definitions(-DENGINE_SDK2013)
add_definitions(-DENGINE_SDK2013)
8 changes: 4 additions & 4 deletions src/makefiles/linux/linux.base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Set(SOURCEPYTHON_LINK_LIBRARIES
)


If(SOURCE_ENGINE MATCHES "bms")
If(SOURCE_ENGINE MATCHES "bms" OR SOURCE_ENGINE MATCHES "sdk2013")
Set(SOURCEPYTHON_LINK_LIBRARIES
"${SOURCEPYTHON_LINK_LIBRARIES}"
${SOURCESDK_LIB}/public/linux32/mathlib.a
Expand Down Expand Up @@ -96,12 +96,12 @@ EndIf()
# General definitions
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LINUX -DPOSIX -DLINUX -DGNUC -DCOMPILER_GCC")

if(SOURCE_ENGINE MATCHES "orangebox" OR SOURCE_ENGINE MATCHES "bms")
if(SOURCE_ENGINE MATCHES "orangebox" OR SOURCE_ENGINE MATCHES "bms" OR SOURCE_ENGINE MATCHES "sdk2013")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_MALLOC_OVERRIDE")
Endif()

# Function alias
If(NOT SOURCE_ENGINE MATCHES "bms")
If(NOT SOURCE_ENGINE MATCHES "bms" AND NOT SOURCE_ENGINE MATCHES "sdk2013")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstrnicmp=strncasecmp -D_snprintf=snprintf")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp")
Expand All @@ -115,7 +115,7 @@ Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -Wno-reorder")

# Others
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse -m32 -fno-strict-aliasing")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fno-threadsafe-statics -v -fvisibility=hidden")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -static-libgcc -static-libstdc++ -fno-threadsafe-statics -v -fvisibility=hidden")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static-libstdc++ doesn't compile well with CS:GO. Once you start the server SP will fail to load with undefined symbol: _zdlpv.



# ------------------------------------------------------------------
Expand Down