clang/gcc: Add build option FREECAD_WARN_ERROR to force to make warnings into errors
This commit is contained in:
@@ -58,6 +58,8 @@ macro(InitializeFreeCADBuildOptions)
|
||||
message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.")
|
||||
message(STATUS "Visit: https://github.com/FreeCAD/FreeCAD-Libpack/releases/ for Windows libpack downloads.")
|
||||
endif()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
option(FREECAD_WARN_ERROR "Make all warnings into errors. " OFF)
|
||||
else(MSVC)
|
||||
option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF)
|
||||
set(FREECAD_LIBPACK_DIR "" CACHE PATH "Directory of the FreeCAD LibPack")
|
||||
|
||||
@@ -268,3 +268,9 @@ MACRO(SET_PYTHON_PREFIX_SUFFIX ProjectName)
|
||||
set_target_properties(${ProjectName} PROPERTIES SUFFIX ".so")
|
||||
endif(WIN32)
|
||||
ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)
|
||||
|
||||
function(target_compile_warn_error ProjectName)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
target_compile_options(${ProjectName} PRIVATE -Werror)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user