Skip to content

Commit a08c1db

Browse files
authored
Clean up uneeded build files and warnings (#67)
Removed no longer needed dll files since we statically link these now. Also cleaned up the steam SDK build behavior. The default windows toolchain is now x686 since there is little to no point in releasing an x64 build to windows as far as I know.
1 parent 91c006b commit a08c1db

28 files changed

+66
-591
lines changed

.github/workflows/cmake-multi-platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
cmake_args: >
4646
-DSDL2MIXER_VENDORED=ON
4747
-DSDL2TTF_VENDORED=ON
48-
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-x86_64.cmake
48+
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-i686.cmake
4949
-GNinja
5050
- os: macos-latest
5151
c_compiler: gcc

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
/data.pack
99
/.vs/
1010
/.data.db
11-
/steamworks_c_wrapper/_build
12-
/steamworks_c_wrapper/sdk
11+
/lib/steamworks_c_wrapper/build
12+
/lib/steamworks_c_wrapper/sdk
1313
*.swp
1414
*~
1515
/steam_appid.txt

CMakeLists.txt

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ set(breakhack_PATCH_VERSION 3)
1111
set(breakhack_RELEASE_TYPE "")
1212

1313
# Checksums
14-
set(breakhack_STEAMAPI_DLL_CHECKSUM 0x18dba28)
15-
set(breakhack_STEAMAPI_SO_CHECKSUM 0x1f5786b)
14+
set(breakhack_STEAMAPI_DLL_CHECKSUM 0x1a20dd5)
15+
set(breakhack_STEAMAPI_SO_CHECKSUM 0x19f8c71)
1616

1717
include(build_deps/cmake/FindCCache.cmake)
1818
include(build_deps/cmake/FindCMocka.cmake)
@@ -23,12 +23,18 @@ configure_file(
2323
"${PROJECT_BINARY_DIR}/config.h"
2424
)
2525

26-
if (EXISTS "${PROJECT_SOURCE_DIR}/steamworks_c_wrapper/sdk")
27-
MESSAGE ( STATUS "Steam SDK located, Steam build enabled")
28-
set(STEAM 1)
26+
set(DISABLE_STEAM_BUILD OFF CACHE BOOL "Disable Steam build")
27+
28+
if (NOT DISABLE_STEAM_BUILD)
29+
if (EXISTS "${PROJECT_SOURCE_DIR}/lib/steamworks_c_wrapper/sdk")
30+
MESSAGE ( STATUS "Steam SDK located, Steam build enabled")
31+
set(STEAM ON)
32+
else ()
33+
MESSAGE ( STATUS "Steam SDK not found, Steam build disabled")
34+
endif()
2935
else ()
30-
MESSAGE ( STATUS "Steam SDK not found, Steam build disabled")
31-
endif()
36+
MESSAGE ( STATUS "Steam build disabled by DISABLE_STEAM_BUILD flag")
37+
endif ()
3238

3339
if (STEAM)
3440
add_subdirectory(lib/steamworks_c_wrapper)
@@ -98,8 +104,7 @@ ENDIF ()
98104

99105
if (STEAM)
100106
include_directories(
101-
${STEAMWORKS_INCLUDE_DIR}
102-
steamworks_c_wrapper/src
107+
lib/steamworks_c_wrapper/src
103108
)
104109
endif ()
105110

@@ -196,7 +201,7 @@ if (STEAM)
196201
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSTEAM_BUILD")
197202
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSTEAM_BUILD")
198203
set(STEAM_SOURCES
199-
src/steam/steamworks_api_wrapper
204+
src/steam/steamworks_api_wrapper.c
200205
)
201206
else ()
202207
set(STEAM_SOURCES "")
@@ -301,6 +306,7 @@ endif ()
301306

302307
if (STEAM)
303308
target_link_libraries(breakhack
309+
${STEAMWORKS_LIBRARY}
304310
steamworks_c_wrapper
305311
)
306312
endif ()
@@ -382,37 +388,21 @@ endif ()
382388
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT "Release")
383389
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
384390
if (WIN32)
385-
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
386-
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
387-
${CMAKE_SOURCE_DIR}/bin/libFLAC-8.dll
388-
${CMAKE_SOURCE_DIR}/bin/libfreetype-6.dll
389-
${CMAKE_SOURCE_DIR}/bin/libmodplug-1.dll
390-
${CMAKE_SOURCE_DIR}/bin/libmpg123-0.dll
391-
${CMAKE_SOURCE_DIR}/bin/libogg-0.dll
392-
${CMAKE_SOURCE_DIR}/bin/libpng16-16.dll
393-
${CMAKE_SOURCE_DIR}/bin/libvorbis-0.dll
394-
${CMAKE_SOURCE_DIR}/bin/libvorbisfile-3.dll
395-
${CMAKE_SOURCE_DIR}/bin/SDL2.dll
396-
${CMAKE_SOURCE_DIR}/bin/SDL2_image.dll
397-
${CMAKE_SOURCE_DIR}/bin/SDL2_mixer.dll
398-
${CMAKE_SOURCE_DIR}/bin/SDL2_ttf.dll
399-
${CMAKE_SOURCE_DIR}/bin/zlib1.dll
400-
)
401391
if (STEAM)
402392
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
403393
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
404-
steamworks_c_wrapper/sdk/redistributable_bin/steam_api.dll
394+
lib/steamworks_c_wrapper/sdk/redistributable_bin/steam_api.dll
405395
)
406396
endif ()
407-
else (WIN32)
397+
else ()
408398
if (STEAM)
409399
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
410400
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
411-
steamworks_c_wrapper/sdk/redistributable_bin/linux64/libsteam_api.so
401+
lib/steamworks_c_wrapper/sdk/redistributable_bin/linux64/libsteam_api.so
412402
build_deps/linux/breakhack.run
413403
)
414404
endif ()
415-
endif (WIN32)
405+
endif ()
416406
include(InstallRequiredSystemLibraries)
417407

418408
INSTALL(TARGETS breakhack

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ lint:
3434

3535
package:
3636
@cmake --build build/release --target package
37+
@cmake --build build/win-release --target package
3738
.PHONY: package
3839

3940
setup:
@@ -44,7 +45,7 @@ setup:
4445
@cmake -B build/release -DCMAKE_BUILD_TYPE=Release -GNinja
4546
@cmake -B build/win-release \
4647
-DCMAKE_BUILD_TYPE=Release \
47-
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-x86_64.cmake \
48+
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-i686.cmake \
4849
-DSDL2MIXER_VENDORED=ON \
4950
-DSDL2TTF_VENDORED=ON \
5051
-GNinja
@@ -54,5 +55,5 @@ setup:
5455

5556
teardown:
5657
@rm -rf build
57-
@rm compile_commands.json
58+
@rm -f compile_commands.json
5859
.PHONY: teardown

bin/SDL2.dll

-973 KB
Binary file not shown.

bin/SDL2_image.dll

-140 KB
Binary file not shown.

bin/SDL2_mixer.dll

-136 KB
Binary file not shown.

bin/SDL2_ttf.dll

-51.5 KB
Binary file not shown.

bin/libFLAC-8.dll

-378 KB
Binary file not shown.

bin/libfreetype-6.dll

-490 KB
Binary file not shown.

0 commit comments

Comments
 (0)