Skip to content
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

Clean up uneeded build files and warnings #67

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cmake_args: >
-DSDL2MIXER_VENDORED=ON
-DSDL2TTF_VENDORED=ON
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-x86_64.cmake
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-i686.cmake
-GNinja
- os: macos-latest
c_compiler: gcc
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
/data.pack
/.vs/
/.data.db
/steamworks_c_wrapper/_build
/steamworks_c_wrapper/sdk
/lib/steamworks_c_wrapper/build
/lib/steamworks_c_wrapper/sdk
*.swp
*~
/steam_appid.txt
Expand Down
50 changes: 20 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ set(breakhack_PATCH_VERSION 3)
set(breakhack_RELEASE_TYPE "")

# Checksums
set(breakhack_STEAMAPI_DLL_CHECKSUM 0x18dba28)
set(breakhack_STEAMAPI_SO_CHECKSUM 0x1f5786b)
set(breakhack_STEAMAPI_DLL_CHECKSUM 0x1a20dd5)
set(breakhack_STEAMAPI_SO_CHECKSUM 0x19f8c71)

include(build_deps/cmake/FindCCache.cmake)
include(build_deps/cmake/FindCMocka.cmake)
Expand All @@ -23,12 +23,18 @@ configure_file(
"${PROJECT_BINARY_DIR}/config.h"
)

if (EXISTS "${PROJECT_SOURCE_DIR}/steamworks_c_wrapper/sdk")
MESSAGE ( STATUS "Steam SDK located, Steam build enabled")
set(STEAM 1)
set(DISABLE_STEAM_BUILD OFF CACHE BOOL "Disable Steam build")

if (NOT DISABLE_STEAM_BUILD)
if (EXISTS "${PROJECT_SOURCE_DIR}/lib/steamworks_c_wrapper/sdk")
MESSAGE ( STATUS "Steam SDK located, Steam build enabled")
set(STEAM ON)
else ()
MESSAGE ( STATUS "Steam SDK not found, Steam build disabled")
endif()
else ()
MESSAGE ( STATUS "Steam SDK not found, Steam build disabled")
endif()
MESSAGE ( STATUS "Steam build disabled by DISABLE_STEAM_BUILD flag")
endif ()

if (STEAM)
add_subdirectory(lib/steamworks_c_wrapper)
Expand Down Expand Up @@ -98,8 +104,7 @@ ENDIF ()

if (STEAM)
include_directories(
${STEAMWORKS_INCLUDE_DIR}
steamworks_c_wrapper/src
lib/steamworks_c_wrapper/src
)
endif ()

Expand Down Expand Up @@ -196,7 +201,7 @@ if (STEAM)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSTEAM_BUILD")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSTEAM_BUILD")
set(STEAM_SOURCES
src/steam/steamworks_api_wrapper
src/steam/steamworks_api_wrapper.c
)
else ()
set(STEAM_SOURCES "")
Expand Down Expand Up @@ -301,6 +306,7 @@ endif ()

if (STEAM)
target_link_libraries(breakhack
${STEAMWORKS_LIBRARY}
steamworks_c_wrapper
)
endif ()
Expand Down Expand Up @@ -382,37 +388,21 @@ endif ()
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT "Release")
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
if (WIN32)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
${CMAKE_SOURCE_DIR}/bin/libFLAC-8.dll
${CMAKE_SOURCE_DIR}/bin/libfreetype-6.dll
${CMAKE_SOURCE_DIR}/bin/libmodplug-1.dll
${CMAKE_SOURCE_DIR}/bin/libmpg123-0.dll
${CMAKE_SOURCE_DIR}/bin/libogg-0.dll
${CMAKE_SOURCE_DIR}/bin/libpng16-16.dll
${CMAKE_SOURCE_DIR}/bin/libvorbis-0.dll
${CMAKE_SOURCE_DIR}/bin/libvorbisfile-3.dll
${CMAKE_SOURCE_DIR}/bin/SDL2.dll
${CMAKE_SOURCE_DIR}/bin/SDL2_image.dll
${CMAKE_SOURCE_DIR}/bin/SDL2_mixer.dll
${CMAKE_SOURCE_DIR}/bin/SDL2_ttf.dll
${CMAKE_SOURCE_DIR}/bin/zlib1.dll
)
if (STEAM)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
steamworks_c_wrapper/sdk/redistributable_bin/steam_api.dll
lib/steamworks_c_wrapper/sdk/redistributable_bin/steam_api.dll
)
endif ()
else (WIN32)
else ()
if (STEAM)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
steamworks_c_wrapper/sdk/redistributable_bin/linux64/libsteam_api.so
lib/steamworks_c_wrapper/sdk/redistributable_bin/linux64/libsteam_api.so
build_deps/linux/breakhack.run
)
endif ()
endif (WIN32)
endif ()
include(InstallRequiredSystemLibraries)

INSTALL(TARGETS breakhack
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ lint:

package:
@cmake --build build/release --target package
@cmake --build build/win-release --target package
.PHONY: package

setup:
Expand All @@ -44,7 +45,7 @@ setup:
@cmake -B build/release -DCMAKE_BUILD_TYPE=Release -GNinja
@cmake -B build/win-release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-x86_64.cmake \
-DCMAKE_TOOLCHAIN_FILE=build_deps/toolchains/mingw-w64-i686.cmake \
-DSDL2MIXER_VENDORED=ON \
-DSDL2TTF_VENDORED=ON \
-GNinja
Expand All @@ -54,5 +55,5 @@ setup:

teardown:
@rm -rf build
@rm compile_commands.json
@rm -f compile_commands.json
.PHONY: teardown
Binary file removed bin/SDL2.dll
Binary file not shown.
Binary file removed bin/SDL2_image.dll
Binary file not shown.
Binary file removed bin/SDL2_mixer.dll
Binary file not shown.
Binary file removed bin/SDL2_ttf.dll
Binary file not shown.
Binary file removed bin/libFLAC-8.dll
Binary file not shown.
Binary file removed bin/libfreetype-6.dll
Binary file not shown.
Binary file removed bin/libmodplug-1.dll
Binary file not shown.
Binary file removed bin/libmpg123-0.dll
Binary file not shown.
Binary file removed bin/libogg-0.dll
Binary file not shown.
Binary file removed bin/libpng16-16.dll
Binary file not shown.
Binary file removed bin/libvorbis-0.dll
Binary file not shown.
Binary file removed bin/libvorbisfile-3.dll
Binary file not shown.
Binary file removed bin/zlib1.dll
Binary file not shown.
171 changes: 0 additions & 171 deletions build_deps/cmake/FindSDL2.cmake

This file was deleted.

Loading
Loading