Skip to content

Commit fe8516d

Browse files
committed
Rename server target
1 parent b274d77 commit fe8516d

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

gamedir/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,5 +426,5 @@ add_dependencies( client convert_utf_files_client )
426426

427427
# Server
428428
bhl_install_files( server "${SERVER_FILES}" )
429-
bhl_install_target( server hl "dlls" )
429+
bhl_install_target( server server "dlls" )
430430
bhl_install_target( server bugfixedapi_amxx "addons/amxmodx/modules" )

src/game/server/CMakeLists.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
set( TARGET_NAME server )
2+
13
set( SOURCE_FILES
24
${GAME_COMMON_SRCS}
35
CMakeLists.txt
@@ -164,25 +166,25 @@ endif()
164166

165167
source_group( TREE ${PROJECT_SOURCE_DIR} FILES ${SOURCE_FILES} )
166168

167-
add_library( hl SHARED ${SOURCE_FILES} )
168-
add_auto_deploy( hl server PublishPathServer.txt )
169-
bhl_version_info( hl "hl.dll" "BugfixedHL-Rebased Server" )
169+
add_library( ${TARGET_NAME} SHARED ${SOURCE_FILES} )
170+
add_auto_deploy( ${TARGET_NAME} server PublishPathServer.txt )
171+
bhl_version_info( ${TARGET_NAME} "hl.dll" "BugfixedHL-Rebased Server" )
170172

171-
target_include_directories( hl PRIVATE
173+
target_include_directories( ${TARGET_NAME} PRIVATE
172174
.
173175
${GAME_COMMON_INCLUDE_PATHS}
174176
${SOURCE_SDK_INCLUDE_PATHS} # For mathlib
175177
)
176178

177-
target_compile_definitions( hl PRIVATE
179+
target_compile_definitions( ${TARGET_NAME} PRIVATE
178180
${GAME_COMMON_DEFINES}
179181
${SOURCE_SDK_DEFINES}
180182
SERVER_DLL
181183
MATHLIB_USE_C_ASSERT
182184
MATHLIB_VECTOR_NONTRIVIAL
183185
)
184186

185-
target_precompile_headers( hl PRIVATE pch.h )
187+
target_precompile_headers( ${TARGET_NAME} PRIVATE pch.h )
186188

187189
# Dependencies
188190
if( WIN32 )
@@ -194,7 +196,7 @@ else()
194196
endif()
195197

196198
# Link with dependencies
197-
target_link_libraries( hl
199+
target_link_libraries( ${TARGET_NAME}
198200
${SERVER_PLAT_LIBS}
199201
semver
200202
Threads::Threads
@@ -204,10 +206,13 @@ target_link_libraries( hl
204206
set( SERVER_LINK_FLAGS "")
205207
set( SERVER_COMPILE_FLAGS "")
206208

207-
set_target_properties( hl PROPERTIES
209+
set_target_properties( ${TARGET_NAME} PROPERTIES
208210
COMPILE_FLAGS "${SERVER_COMPILE_FLAGS}"
209211
LINK_FLAGS "${SHARED_GAME_LINKER_FLAGS} ${SERVER_LINK_FLAGS}"
210212
)
211213

212214
# Remove "lib" prefix
213-
set_target_properties( hl PROPERTIES PREFIX "" )
215+
set_target_properties( ${TARGET_NAME} PROPERTIES PREFIX "" )
216+
217+
# Set the original name
218+
set_target_properties( ${TARGET_NAME} PROPERTIES OUTPUT_NAME "hl" )

src/tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if( BUILD_TESTING )
7272
${TESTS_SERVER}
7373
)
7474

75-
add_dependencies( test_server hl )
75+
add_dependencies( test_server server )
7676

7777
target_include_directories( test_server PRIVATE
7878
${CMAKE_CURRENT_SOURCE_DIR}/common
@@ -107,7 +107,7 @@ if( BUILD_TESTING )
107107
)
108108

109109
add_test( NAME server
110-
COMMAND test_server "$<TARGET_FILE:hl>"
110+
COMMAND test_server "$<TARGET_FILE:server>"
111111
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/workdir"
112112
)
113113

0 commit comments

Comments
 (0)