1-
21set (root_src
32 lodepng.cpp
43 main.cpp
@@ -139,7 +138,8 @@ set ( coopmod_src
139138 CoopMod/connectionTCP.cpp
140139 CoopMod/CoopMenu.cpp
141140 CoopMod/CoopState.cpp
142- CoopMod/CrashHandler.cpp
141+ # CrashHandler removed for WinXP compatibility
142+ # CoopMod/CrashHandler.cpp
143143 CoopMod/OptionsMultiplayer.cpp
144144 CoopMod/Profile.cpp
145145)
@@ -444,14 +444,13 @@ set ( rapidyaml_src
444444 ../libs/rapidyaml/c4/yml/tag.cpp
445445 ../libs/rapidyaml/c4/yml/tree.cpp
446446 ../libs/rapidyaml/c4/yml/version.cpp
447-
448447)
449448
450449set ( cxx_src
451450 ${root_src}
452451 ${basescape_src}
453452 ${battlescape_src}
454- ${coopmod_src}
453+ ${coopmod_src}
455454 ${engine_src}
456455 ${geoscape_src}
457456 ${interface_src}
@@ -474,12 +473,9 @@ if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_BUILD_TYPE}" STREQUA
474473 set_property ( SOURCE OpenXcom.rc APPEND PROPERTY COMPILE_DEFINITIONS _DEBUG )
475474endif ()
476475if ( "${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
477- # attempt to limit the executable size
478476 set_property ( SOURCE ${cxx_src} APPEND_STRING PROPERTY COMPILE_FLAGS -femit-struct-debug-reduced \ )
479477endif ()
480478if ( "${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
481- # C++ - only warnings
482- # C and C++ warnings
483479 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wall \ )
484480 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wextra \ )
485481 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Winit-self \ )
@@ -495,14 +491,10 @@ if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
495491 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-unused-parameter \ )
496492 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-inline \ )
497493 if ( "${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" )
498- # apple clang 11.0 goes crazy with -Wshadow on the yaml-cpp source code
499494 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wshadow \ )
500- # add warning flags recognized by g++ but not by clang
501495 set_property ( SOURCE ${cxx_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wsuggest-override \ )
502496 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wclobbered \ )
503497 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Wlogical-op \ )
504- elseif ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
505- # add warning flags recognized by clang but not by g++
506498 endif ()
507499 if ( FATAL_WARNING )
508500 set_property ( SOURCE ${cxx_src} ${c_src} APPEND_STRING PROPERTY COMPILE_FLAGS -Werror \ )
@@ -518,7 +510,6 @@ if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
518510endif ()
519511
520512if ( MSVC )
521- # Set warning levels for Debug and Release with debug info
522513 set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W${MSVC_WARNING_LEVEL} " )
523514 set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W${MSVC_WARNING_LEVEL} " )
524515 if ( FATAL_WARNING )
@@ -614,7 +605,7 @@ endif ()
614605
615606install ( TARGETS openxcom ${install_dest} DESTINATION ${CMAKE_INSTALL_BINDIR} )
616607
617- # --- Windows / MinGW / MXE link setup (safe for Linux/macOS) ------------------
608+ # --- Windows / MinGW / MXE link setup --------------------- ------------------
618609
619610# jsoncpp: on MinGW/MXE force picking it from the toolchain prefix if available
620611if ( MINGW )
@@ -627,61 +618,51 @@ else ()
627618 set ( JSONCPP_LINK jsoncpp )
628619endif ()
629620
630- # Win32 system libs + tools
621+ # Extra Win32 libs we explicitly need (keep minimal for XP)
631622set (WIN32_SYSTEM_LIBS "" )
632- set (WIN32_TOOLS_LIBS "" )
633-
634623if ( WIN32 )
635624 set (WIN32_SYSTEM_LIBS advapi32 shell32 shlwapi wininet urlmon)
636- set (WIN32_TOOLS_LIBS imagehlp dbghelp)
637-
638625 # keep export-all-symbols behavior
639626 set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-all-symbols" )
640-
641627 if ( MINGW )
642628 # subsystem/static flags as link options (not as "libraries")
643629 target_link_options (openxcom PRIVATE -mwindows -static )
644-
645- # SDL WinMain glue (WinXP/MinGW)
646- # (SDL itself comes from PKG_DEPS_LDFLAGS)
630+ # SDL WinMain glue
647631 list (APPEND WIN32_SYSTEM_LIBS mingw32 SDLmain)
648632 endif ()
649633endif ()
650634
651- # IMPORTANT: order matters with static linking!
652- # Put libraries that *depend on others* first, and their dependencies later.
635+ # IMPORTANT: order matters for static linking!
653636target_link_libraries (openxcom PRIVATE
654637 ${PKG_DEPS_LDFLAGS}
655638 ${JSONCPP_LINK}
656639
657- # These use vorbis/ogg → dependencies AFTER
640+ # Vorbis stack
658641 vorbisfile
659642 vorbis
660643 ogg
661644
662- # SDL_net uses ws2_32/iphlpapi → dependencies AFTER SDL_net
645+ # SDL_net stack ( dependencies after)
663646 SDL_net
664647 ws2_32
665648 iphlpapi
666649
667- # Common Windows multimedia / GUID deps used by SDL_* stacks
650+ # Common Win libs used by SDL stacks
668651 winmm
669652 dxguid
670653
671- # SDL_image/ SDL_mixer optional codec deps (only if your MXE build enables them )
654+ # SDL_image / SDL_mixer codecs (only if enabled in MXE build)
672655 jpeg
673656 png
674657 webp
675658 smpeg
676659 modplug
677660
678661 ${WIN32_SYSTEM_LIBS}
679- ${WIN32_TOOLS_LIBS}
680662)
681663
682664# ---------------------------------------------------------------------------
683665
684- # Pack libraries into bundle and link executable appropriately
685666if ( APPLE AND CREATE_BUNDLE )
686667 include ( PostprocessBundle )
687668 postprocess_bundle ( openxcom ${bundle_path} )
@@ -694,18 +675,18 @@ if ( NOT EMBED_ASSETS )
694675 add_custom_command ( TARGET openxcom
695676 POST_BUILD
696677 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR} /bin/${binpath} ${bundle_path} /Contents/Resources/${binpath}
697- VERBATIM )
678+ VERBATIM )
698679 else ()
699680 add_custom_command ( TARGET openxcom
700681 POST_BUILD
701682 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR} /bin/${binpath} ${EXECUTABLE_OUTPUT_PATH} /${binpath}
702- VERBATIM )
683+ VERBATIM )
703684 install ( DIRECTORY ${CMAKE_SOURCE_DIR} /bin/${binpath} DESTINATION ${data_install_dir} )
704685 endif ()
705686 endforeach ()
706687endif ()
707688
708- # Copy Windows DLLs to bin folder
689+ # Copy Windows DLLs to bin folder (noop for static MXE, but kept for compatibility)
709690if ( WIN32 )
710691 if ( CMAKE_CL_64 )
711692 file ( GLOB Windows_dll "${DEPS_DIR} /lib/x64/*.dll" )
@@ -716,12 +697,11 @@ if ( WIN32 )
716697 add_custom_command ( TARGET openxcom
717698 POST_BUILD
718699 COMMAND ${CMAKE_COMMAND} -E copy ${dll} ${EXECUTABLE_OUTPUT_PATH}
719- VERBATIM )
700+ VERBATIM )
720701 install ( FILES ${dll} DESTINATION bin)
721702 endforeach ()
722703endif ()
723704
724- #Setup source groups for IDE
725705if ( MSVC OR "${CMAKE_GENERATOR} " STREQUAL "Xcode" )
726706 source_group ( "Basescape" FILES ${basescape_src} )
727707 source_group ( "Battlescape" FILES ${battlescape_src} )
@@ -736,4 +716,4 @@ if ( MSVC OR "${CMAKE_GENERATOR}" STREQUAL "Xcode" )
736716 if ( APPLE )
737717 source_group ( "SDL" FILES ${sdl_src} )
738718 endif ()
739- endif ()
719+ endif ()
0 commit comments