Skip to content

Commit

Permalink
upd: static build compile option for windows; add: executable version…
Browse files Browse the repository at this point in the history
… info
  • Loading branch information
Casqade committed Apr 2, 2023
1 parent aa5d3aa commit 426ee37
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 34 deletions.
64 changes: 33 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.7)

project(BiPlanes)
set(TARGET Biplanes)
project(${TARGET})

set (CMAKE_CXX_STANDARD 14)

Expand All @@ -11,45 +12,46 @@ find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)

set (PROJECT_SOURCES
src/biplanes.cpp
src/matchmake.cpp
src/controls.cpp
src/menu.cpp
src/plane.cpp
src/bullet.cpp
src/cloud.cpp
src/zeppelin.cpp
src/sdl.cpp
src/render.cpp
src/utility.cpp
src/init_vars.cpp
)
src/biplanes.cpp
src/matchmake.cpp
src/controls.cpp
src/menu.cpp
src/plane.cpp
src/bullet.cpp
src/cloud.cpp
src/zeppelin.cpp
src/sdl.cpp
src/render.cpp
src/utility.cpp
src/init_vars.cpp
)

set (GAME_ICON src/icon.rc)

add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${GAME_ICON})
add_executable(${TARGET} ${PROJECT_SOURCES} ${GAME_ICON} src/version.rc)

target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIR})

target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIR})
target_compile_options(${TARGET} PRIVATE -w -O3 -s -Wno-narrowing)

target_compile_options(${PROJECT_NAME} PRIVATE -w -O3 -s -Wno-narrowing)
target_link_libraries(${TARGET}
SDL2::Main
SDL2::Image
SDL2::Mixer
)

target_link_libraries(BiPlanes
SDL2::Main
SDL2::Image
SDL2::Mixer)

if(WIN32)
set_target_properties( ${PROJECT_NAME}
set_target_properties( ${TARGET}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
target_link_libraries(${PROJECT_NAME} wsock32 ws2_32 -static-libgcc -static-libstdc++)
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/bin)
)
target_link_libraries(${TARGET} -static -static-libgcc -static-libstdc++ wsock32 ws2_32)
file(COPY assets DESTINATION ${CMAKE_BINARY_DIR}/bin)
elseif(APPLE)
install(TARGETS BiPlanes DESTINATION bin)
install(TARGETS ${TARGET} DESTINATION bin)
file(COPY assets DESTINATION bin)
else()
install(TARGETS BiPlanes DESTINATION bin)
file(COPY assets DESTINATION bin)
install(TARGETS ${TARGET} DESTINATION bin)
file(COPY assets DESTINATION bin)
endif()
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ it's recommended to use newer
zlib1.dll
SDL2_mixer.dll

*If you want to launch game on different PC you also
need to provide **libwinpthread-1.dll** from **mingw32/bin***


**6. Make sure that 'assets' folder is placed next to executable.**

Expand Down
26 changes: 26 additions & 0 deletions src/version.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#define VER_FILEVERSION 1,0,5
#define VER_FILEVERSION_STR "1.0.5"


VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
PRODUCTVERSION VER_FILEVERSION
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "https://regular-dev.org"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "FileDescription", "Biplanes Revival"
VALUE "LegalCopyright", "Copyright (C) 2023 https://regular-dev.org community"
VALUE "OriginalFilename", "Biplanes.exe"
VALUE "ProductName", "Biplanes Revival"
VALUE "ProductVersion", VER_FILEVERSION_STR
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 1252
}
}

0 comments on commit 426ee37

Please sign in to comment.