@@ -19,6 +19,11 @@ CHECK_LIBRARY_EXISTS(m floor "" HAVE_LIB_M)
1919set (DIRKSIMPLE_SDL_DEFAULT ON )
2020set (DIRKSIMPLE_LIBRETRO_DEFAULT ON )
2121
22+ if (CMAKE_SYSTEM_NAME STREQUAL "DOS" )
23+ set (DOS TRUE )
24+ set (DIRKSIMPLE_LIBRETRO_DEFAULT OFF )
25+ endif ()
26+
2227if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
2328 set (EMSCRIPTEN TRUE )
2429 set (IPO_SUPPORTED YES ) # !!! FIXME: -flto=thin currently broken in Emscripten: https://github.com/emscripten-core/emscripten/issues/12763
@@ -51,7 +56,7 @@ if(MSVC)
5156 add_definitions (-wd4305 ) # truncation from double to float
5257else () # This assumes you have GCC or Clang at the moment.
5358 add_definitions (-Wall )
54- if (NOT EMSCRIPTEN AND NOT ANDROID )
59+ if (NOT DOS AND NOT EMSCRIPTEN AND NOT ANDROID )
5560 set (USE_PTHREAD TRUE )
5661 endif ()
5762endif ()
@@ -60,7 +65,9 @@ add_library(dirksimple-ogg STATIC
6065 thirdparty/libogg/src/bitwise.c
6166 thirdparty/libogg/src/framing.c
6267)
63- set_target_properties (dirksimple-ogg PROPERTIES POSITION_INDEPENDENT_CODE ON )
68+ if (NOT DOS)
69+ set_target_properties (dirksimple-ogg PROPERTIES POSITION_INDEPENDENT_CODE ON )
70+ endif ()
6471target_include_directories (dirksimple-ogg PRIVATE
6572 thirdparty/libogg/include
6673)
@@ -88,7 +95,9 @@ add_library(dirksimple-vorbis STATIC
8895 thirdparty/libvorbis/lib/vorbisfile.c
8996 thirdparty/libvorbis/lib/window.c
9097)
91- set_target_properties (dirksimple-vorbis PROPERTIES POSITION_INDEPENDENT_CODE ON )
98+ if (NOT DOS)
99+ set_target_properties (dirksimple-vorbis PROPERTIES POSITION_INDEPENDENT_CODE ON )
100+ endif ()
92101target_include_directories (dirksimple-vorbis PRIVATE
93102 thirdparty/libogg/include
94103 thirdparty/libvorbis/include
@@ -110,7 +119,9 @@ add_library(dirksimple-theora STATIC
110119 thirdparty/libtheora/lib/quant.c
111120 thirdparty/libtheora/lib/state.c
112121)
113- set_target_properties (dirksimple-theora PROPERTIES POSITION_INDEPENDENT_CODE ON )
122+ if (NOT DOS)
123+ set_target_properties (dirksimple-theora PROPERTIES POSITION_INDEPENDENT_CODE ON )
124+ endif ()
114125target_include_directories (dirksimple-theora PRIVATE
115126 thirdparty/libogg/include
116127 thirdparty/libtheora/include
@@ -119,7 +130,9 @@ target_include_directories(dirksimple-theora PRIVATE
119130add_library (dirksimple-theoraplay STATIC
120131 thirdparty/theoraplay/theoraplay.c
121132)
122- set_target_properties (dirksimple-theoraplay PROPERTIES POSITION_INDEPENDENT_CODE ON )
133+ if (NOT DOS)
134+ set_target_properties (dirksimple-theoraplay PROPERTIES POSITION_INDEPENDENT_CODE ON )
135+ endif ()
123136target_include_directories (dirksimple-theoraplay PRIVATE
124137 thirdparty/libogg/include
125138 thirdparty/libvorbis/include
@@ -131,8 +144,9 @@ target_compile_definitions(dirksimple-theoraplay PRIVATE "-DTHEORAPLAY_NO_FOPEN_
131144add_library (dirksimple-lodepng STATIC
132145 thirdparty/lodepng/lodepng.c
133146)
134- set_target_properties (dirksimple-lodepng PROPERTIES POSITION_INDEPENDENT_CODE ON )
135-
147+ if (NOT DOS)
148+ set_target_properties (dirksimple-lodepng PROPERTIES POSITION_INDEPENDENT_CODE ON )
149+ endif ()
136150add_library (dirksimple-lua STATIC
137151 thirdparty/lua/src/lapi.c
138152 thirdparty/lua/src/ldebug.c
@@ -167,8 +181,11 @@ add_library(dirksimple-lua STATIC
167181 thirdparty/lua/src/lcorolib.c
168182 thirdparty/lua/src/loadlib.c
169183)
170- set_target_properties (dirksimple-lua PROPERTIES POSITION_INDEPENDENT_CODE ON )
171- if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )
184+ if (NOT DOS)
185+ set_target_properties (dirksimple-lua PROPERTIES POSITION_INDEPENDENT_CODE ON )
186+ endif ()
187+
188+ if (NOT DOS AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows" )
172189 target_compile_definitions (dirksimple-lua PRIVATE "-DLUA_USE_POSIX=1" )
173190endif ()
174191
@@ -199,6 +216,9 @@ if(DIRKSIMPLE_SDL)
199216 if (HAVE_LIB_M)
200217 target_link_libraries (dirksimple m )
201218 endif ()
219+ if (DOS)
220+ set_target_properties (dirksimple PROPERTIES OUTPUT_NAME "DIRKSIMP" ) # 8.3 file names!
221+ endif ()
202222 if (EMSCRIPTEN)
203223 set_target_properties (dirksimple PROPERTIES OUTPUT_NAME "dirksimple-wasm" )
204224 set_target_properties (dirksimple PROPERTIES LINK_FLAGS "${IPO_FLAG} -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=0 -s EXPORTED_RUNTIME_METHODS=['addRunDependency','removeRunDependency'] -s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=['$autoResumeAudioContext','$dynCall']" )
0 commit comments