Skip to content
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
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ jobs:
matrix:
os:
- runner: windows-latest
preset: win32
cc: cl
cxx: cl
name: Windows-x86
- runner: windows-latest
preset: win64
preset: win
cc: cl
cxx: cl
name: Windows-x64
Expand Down Expand Up @@ -80,7 +75,7 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os.runner == 'windows-latest' }}
with:
arch: ${{ matrix.os.preset }}
arch: win64

- name: Configure CMake
env:
Expand Down
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ install(
if(UNIX)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wno-multichar;${BITS};${EXTRA_CXX_FLAGS}>")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${BITS}>")

find_package(SDL2 REQUIRED)
# Some versions of the SDL2 find_package set SDL2_INCLUDE_DIR and some set a plural SDL2_INCLUDE_DIRS. Check both.
message("SDL2 Include Dir is ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}")
endif()

find_package(SDL2 REQUIRED)
# Some versions of the SDL2 find_package set SDL2_INCLUDE_DIR and some set a plural SDL2_INCLUDE_DIRS. Check both.
message("SDL2 Include Dir is ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}")


if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message("Building for Linux")
add_compile_definitions(__LINUX__ _USE_OGL_ACTIVE_TEXTURES PRIMARY_HOG=\"d3-linux.hog\")
Expand Down Expand Up @@ -178,13 +179,13 @@ add_subdirectory(czip)
add_subdirectory(d3music)
add_subdirectory(ddebug)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(BUILD_EDITOR AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_subdirectory(dd_grwin32)
add_subdirectory(win32)
else()
add_subdirectory(linux)
endif()

add_subdirectory(linux)

add_subdirectory(ddio)
add_subdirectory(dd_video)
add_subdirectory(fix)
Expand Down
38 changes: 5 additions & 33 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,7 @@
"binaryDir": "${sourceDir}/builds/${presetName}"
},
{
"name": "win32",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"architecture": {
"strategy": "external",
"value": "x86"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-windows-static-md"
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "win64",
"name": "win",
"inherits": "defaults",
"generator": "Ninja Multi-Config",
"condition": {
Expand Down Expand Up @@ -65,12 +47,8 @@
],
"buildPresets": [
{
"name": "win32",
"configurePreset": "win32"
},
{
"name": "win64",
"configurePreset": "win64"
"name": "win",
"configurePreset": "win"
},
{
"name": "mac",
Expand All @@ -90,16 +68,10 @@
}
},
{
"name": "win32",
"inherits": "defaults",
"description": "Testing under Windows x86",
"configurePreset": "win32"
},
{
"name": "win64",
"name": "win",
"inherits": "defaults",
"description": "Testing under Windows x64",
"configurePreset": "win64"
"configurePreset": "win"
},
{
"name": "mac",
Expand Down
23 changes: 9 additions & 14 deletions Descent3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,35 +268,30 @@ set(CPPS
voice.cpp
weapon.cpp
WeaponFire.cpp
weather.cpp)
weather.cpp
loki_utils.c
sdlmain.cpp)

if(WIN32)
set(PLATFORM_LIBS dd_grwin32 win32 wsock32.lib winmm.lib
${DSOUND_LIBRARY} ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} ${DDRAW_LIBRARY})
set(PLATFORM_CPPS winmain.cpp)
set(PLATFORM_LIBS wsock32.lib winmm.lib)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:LIBC")
endif()

if(UNIX AND NOT APPLE)
set(PLATFORM_LIBS linux SDL2::SDL2 m ${CMAKE_DL_LIBS})
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp)
set(PLATFORM_LIBS m ${CMAKE_DL_LIBS})
endif()

if(APPLE)
set(PLATFORM_LIBS linux SDL2::SDL2)
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp)
set(PLATFORM_LIBS)
set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework Cocoa -framework OpenGL -framework Carbon")
endif()

file(GLOB_RECURSE INCS "../lib/*.h")

add_executable(Descent3
WIN32
${HEADERS} ${CPPS} ${PLATFORM_CPPS} ${INCS}
)
target_link_libraries(Descent3
add_executable(Descent3 WIN32 ${HEADERS} ${CPPS} ${INCS})
target_link_libraries(Descent3 PRIVATE
2dlib AudioEncode bitmap cfile czip d3music dd_video ddebug ddio libmve libacm
fix grtext manage mem misc model module movie stream_audio
fix grtext manage mem misc model module movie stream_audio linux SDL2::SDL2
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
${PLATFORM_LIBS})
target_include_directories(Descent3 PRIVATE ${PROJECT_BINARY_DIR}/lib)
Expand Down
34 changes: 0 additions & 34 deletions Descent3/SDLMain.h

This file was deleted.

Loading