Skip to content

Commit

Permalink
DOS backend
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Dec 29, 2022
1 parent bd8f5bf commit 71642aa
Show file tree
Hide file tree
Showing 14 changed files with 2,863 additions and 10 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ t2-output
.cxx
build
kk
vc
vc
cmake-build-debug
cmake-build-debug-emscripten
cmake-build-release
cmake-build-release-emscripten
.cache
tests/.DS_Store
**/.DS_Store
tests/dos/tools/djgpp
tests/dos/tools/dosbox-x
tests/dos/tools/gdb
41 changes: 32 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ set(SrcGL
src/gl/MiniFB_GL.c
)

#--
set(SrcDOS
src/dos/DOSMiniFB.c
src/dos/vesa.c
)

# Avoid RelWithDebInfo and MinSizeRel
#--------------------------------------
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
Expand Down Expand Up @@ -123,13 +129,15 @@ endif()
if(NOT MSVC)
# Avoid default flag values
#--------------------------------------
set(CMAKE_C_FLAGS "")
set(CMAKE_C_FLAGS_DEBUG "" )
set(CMAKE_C_FLAGS_RELEASE "")

set(CMAKE_CXX_FLAGS "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "")
if (NOT DJGPP)
set(CMAKE_C_FLAGS "")
set(CMAKE_C_FLAGS_DEBUG "" )
set(CMAKE_C_FLAGS_RELEASE "")

set(CMAKE_CXX_FLAGS "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "")
endif()

set(CMAKE_OBJC_FLAGS "")
set(CMAKE_OBJC_FLAGS_DEBUG "")
Expand All @@ -141,7 +149,12 @@ if(NOT MSVC)

# Set our flags
#--------------------------------------
add_compile_options("$<$<CONFIG:Debug>:-g>")
if (DJGPP)
add_compile_options("$<$<CONFIG:Debug>:-gdwarf>")
add_compile_options("$<$<CONFIG:Debug>:-save-temps>")
else()
add_compile_options("$<$<CONFIG:Debug>:-g>")
endif()
add_compile_options("$<IF:$<CONFIG:Debug>,-O0,-O2>")
add_compile_options(-Wall -Wextra)
add_compile_options(-Wno-switch -Wno-unused-function -Wno-unused-parameter -Wno-implicit-fallthrough)
Expand Down Expand Up @@ -231,6 +244,10 @@ elseif(UNIX)
list(APPEND SrcLib ${SrcX11})
endif()

elseif(DJGPP)

list(APPEND SrcLib ${SrcDOS})

endif()

# Library
Expand Down Expand Up @@ -304,7 +321,6 @@ link_libraries(minifb)
#--------------------------------------
if(MINIFB_BUILD_EXAMPLES)
if(NOT IOS)

add_executable(noise
tests/noise.c
)
Expand All @@ -329,6 +345,13 @@ if(MINIFB_BUILD_EXAMPLES)
tests/fullscreen.c
)

if(DJGPP)

add_executable(dos
tests/dos/dos.c
)

endif()
else()

add_executable(noise
Expand Down
Loading

0 comments on commit 71642aa

Please sign in to comment.