mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
Vendor the CMake modules FSO actually used from the ~150-file rpavlik
submodule into cmake/, then drop the submodule:
- EnableExtraCompilerWarnings.cmake (toolchain warning flags)
- CreateLaunchers.cmake + its CleanDirectoryList.cmake dependency and
launcher-templates/ (IDE launcher generation for the game and FREDs)
- MSVCMultipleProcessCompile.cmake + its ListCombinations.cmake dependency
Also remove the dead cotire module-path entry and the vestigial
ENABLE_COTIRE option (cotire is never invoked and its directory no longer
exists), and repoint the submodule-initialized check at libRocket.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
89 lines
2.5 KiB
CMake
89 lines
2.5 KiB
CMake
# - Add flags to compile with extra warnings
|
|
#
|
|
# enable_extra_compiler_warnings(<targetname>)
|
|
# globally_enable_extra_compiler_warnings() - to modify CMAKE_CXX_FLAGS, etc
|
|
# to change for all targets declared after the command, instead of per-command
|
|
#
|
|
#
|
|
# Original Author:
|
|
# 2010 Ryan Pavlik <[email protected]> <[email protected]>
|
|
# http://academic.cleardefinition.com
|
|
# Iowa State University HCI Graduate Program/VRAC
|
|
#
|
|
# Copyright Iowa State University 2009-2010.
|
|
# Distributed under the Boost Software License, Version 1.0.
|
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
|
# http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
if(__enable_extra_compiler_warnings)
|
|
return()
|
|
endif()
|
|
set(__enable_extra_compiler_warnings YES)
|
|
|
|
macro(_enable_extra_compiler_warnings_flags)
|
|
set(_flags)
|
|
if(MSVC)
|
|
option(COMPILER_WARNINGS_EXTREME
|
|
"Use compiler warnings that are probably overkill."
|
|
off)
|
|
mark_as_advanced(COMPILER_WARNINGS_EXTREME)
|
|
set(_flags "/W4")
|
|
if(COMPILER_WARNINGS_EXTREME)
|
|
set(_flags "${_flags} /Wall /wd4619 /wd4668 /wd4820 /wd4571 /wd4710")
|
|
endif()
|
|
else()
|
|
include(CheckCXXCompilerFlag)
|
|
set(_flags)
|
|
|
|
check_cxx_compiler_flag(-W SUPPORTS_W_FLAG)
|
|
if(SUPPORTS_W_FLAG)
|
|
set(_flags "${_flags} -W")
|
|
endif()
|
|
|
|
check_cxx_compiler_flag(-Wall SUPPORTS_WALL_FLAG)
|
|
if(SUPPORTS_WALL_FLAG)
|
|
set(_flags "${_flags} -Wall")
|
|
endif()
|
|
|
|
check_cxx_compiler_flag(-Wextra SUPPORTS_WEXTRA_FLAG)
|
|
if(SUPPORTS_WEXTRA_FLAG)
|
|
set(_flags "${_flags} -Wextra")
|
|
endif()
|
|
|
|
if(SUPPORTS_WALL_FLAG)
|
|
# At least GCC includes -Wmaybe-uninitialized in -Wall, which
|
|
# unneccesarily whines about boost::optional (by it's nature
|
|
# it's a "maybe" warning - prone to noisy false-positives)
|
|
check_cxx_compiler_flag(-Wno-maybe-uninitialized SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
|
|
if(SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
|
|
set(_flags "${_flags} -Wno-maybe-uninitialized")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endmacro()
|
|
|
|
function(enable_extra_compiler_warnings _target)
|
|
_enable_extra_compiler_warnings_flags()
|
|
get_target_property(_origflags ${_target} COMPILE_FLAGS)
|
|
if(_origflags)
|
|
set_property(TARGET
|
|
${_target}
|
|
PROPERTY
|
|
COMPILE_FLAGS
|
|
"${_flags} ${_origflags}")
|
|
else()
|
|
set_property(TARGET
|
|
${_target}
|
|
PROPERTY
|
|
COMPILE_FLAGS
|
|
"${_flags}")
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
function(globally_enable_extra_compiler_warnings)
|
|
_enable_extra_compiler_warnings_flags()
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE)
|
|
endfunction()
|