Skip to content

Commit

Permalink
Merge branch 'vanilla' into feature/td_rules2
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniBlade committed Jun 21, 2024
2 parents d0c729d + 5bff786 commit dbaf9c5
Show file tree
Hide file tree
Showing 55 changed files with 2,314 additions and 1,699 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Create Development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: "marvinpinto/action-automatic-releases@latest"
uses: "0xDylan/action-auto-releases[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -112,7 +112,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Restore cache
id: dep-cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -107,7 +107,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -138,7 +138,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: ilammy/msvc-dev-cmd@v1.12.1
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x86

- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: pwsh
run: |
$gitoutput = git rev-parse --short HEAD
echo "sha_short=${gitoutput}" >> $env:GITHUB_OUTPUT
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -66,7 +69,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand All @@ -86,13 +89,16 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: ilammy/msvc-dev-cmd@v1.12.1
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: ${{ matrix.platform }}

- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: pwsh
run: |
$gitoutput = git rev-parse --short HEAD
echo "sha_short=${gitoutput}" >> $env:GITHUB_OUTPUT
- name: Set variables
id: vars
Expand Down Expand Up @@ -152,7 +158,7 @@ jobs:

- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Development Build
tag_name: "latest"
Expand All @@ -164,7 +170,7 @@ jobs:

- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.networking == 'net' }}
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
artifact/*
Expand Down
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FeatureSummary)
include(CheckCXXCompilerFlag)

if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
endif()

project(VanillaConquer C CXX)
Expand Down Expand Up @@ -85,10 +85,34 @@ else()
endif()

if(WIN32)
add_definitions(-DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)
set(COMMON_LIBS winmm)
endif()

if(NOT MSVC)
# GCC and Clang don't check new allocations by default while MSVC does.
message(STATUS "Checking whether compiler supports -fcheck-new")
check_cxx_compiler_flag("-Werror -fcheck-new" HAVE_CHECK_NEW)

if(HAVE_CHECK_NEW)
message(STATUS "yes")
list(APPEND VC_CXX_FLAGS -fcheck-new)
else()
message(STATUS "no")
endif()

# Some platforms default to an unsigned char, this fixes that.
message(STATUS "Checking whether compiler supports -fsigned-char")
check_cxx_compiler_flag("-Werror -fsigned-char" HAVE_SIGNED_CHAR)

if(HAVE_SIGNED_CHAR)
message(STATUS "yes")
list(APPEND VC_CXX_FLAGS -fsigned-char)
else()
message(STATUS "no")
endif()
endif()

set(VANILLA_DEFS "")
set(VANILLA_LIBS "")

Expand Down
13 changes: 7 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
"cacheVariables": {
"CMAKE_CXX_FLAGS_DEBUG": "-g3 -Og",
"CMAKE_C_FLAGS_DEBUG": "-g3 -Og",
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -g3 -DNDEBUG",
"CMAKE_C_FLAGS_RELEASE": "-O3 -g3 -DNDEBUG",
"VC_CXX_FLAGS": "-w;-Wwrite-strings;-Werror=write-strings;-fcheck-new;-DNOMINMAX",
"CMAKE_CXX_FLAGS_RELEASE": "-O2 -g3 -DNDEBUG",
"CMAKE_C_FLAGS_RELEASE": "-O2 -g3 -DNDEBUG",
"VC_CXX_FLAGS": "-w;-Wwrite-strings;-Werror=write-strings",
"MAP_EDITORTD": "ON",
"MAP_EDITORRA": "ON",
"BUILD_TOOLS": "ON"
Expand Down Expand Up @@ -174,11 +174,11 @@
"cacheVariables": {
"CMAKE_CXX_FLAGS_DEBUG": "-g -Og",
"CMAKE_C_FLAGS_DEBUG": "-g -Og",
"CMAKE_CXX_FLAGS_RELEASE": "-O3 -g -DNDEBUG",
"CMAKE_C_FLAGS_RELEASE": "-O3 -g -DNDEBUG",
"CMAKE_CXX_FLAGS_RELEASE": "-O2 -g -DNDEBUG",
"CMAKE_C_FLAGS_RELEASE": "-O2 -g -DNDEBUG",
"CMAKE_EXE_LINKER_FLAGS": "-static-libstdc++ -static-libgcc",
"CMAKE_SHARESD_LINKER_FLAGS": "-static-libstdc++ -static-libgcc",
"VC_CXX_FLAGS": "-fpermissive;-w;-Wwrite-strings;-Werror=write-strings;-fcheck-new;-fsigned-char;-DNOMINMAX",
"VC_CXX_FLAGS": "-w;-Wwrite-strings;-Werror=write-strings",
"MAP_EDITORTD": "ON",
"MAP_EDITORRA": "ON",
"BUILD_TOOLS": "ON"
Expand All @@ -199,6 +199,7 @@
"BUILD_VANILLARA": "OFF",
"MAP_EDITORTD": "OFF",
"MAP_EDITORRA": "OFF",
"VC_CXX_FLAGS": "-fpermissive;-w;-Wwrite-strings;-Werror=write-strings",
"BUILD_TOOLS": "OFF"
}
},
Expand Down
9 changes: 5 additions & 4 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ set(COMMONR_SRC
soundio_null.cpp
video_null.cpp
wwkeyboard.cpp
wwkeyboard_win32.cpp
wwmouse.cpp
)

Expand All @@ -134,18 +135,18 @@ if(DSOUND)
list(APPEND COMMONV_SRC soundio.cpp vqaaudio_dsound.cpp)
list(APPEND VANILLA_LIBS dsound)
elseif(OPENAL)
list(APPEND COMMONV_SRC soundio_openal.cpp vqaaudio_openal.cpp)
list(APPEND COMMONV_SRC soundio_common.cpp soundio_openal.cpp vqaaudio_openal.cpp)
else()
list(APPEND COMMONV_SRC soundio_null.cpp vqaaudio_null.cpp)
endif()

if(DDRAW)
list(APPEND COMMONV_SRC video_ddraw.cpp)
list(APPEND COMMONV_SRC video_ddraw.cpp wwkeyboard_win32.cpp)
list(APPEND VANILLA_LIBS ddraw)
elseif(SDL2)
list(APPEND COMMONV_SRC video_sdl2.cpp)
list(APPEND COMMONV_SRC video_sdl2.cpp wwkeyboard_sdl2.cpp)
elseif(SDL1)
list(APPEND COMMONV_SRC video_sdl1.cpp)
list(APPEND COMMONV_SRC video_sdl1.cpp wwkeyboard_sdl1.cpp)
else()
list(APPEND COMMONV_SRC video_null.cpp)
endif()
Expand Down
Loading

0 comments on commit dbaf9c5

Please sign in to comment.