While preparing a test release I encountered some things that are not yet clear to me:
* there is the CMake option "FREECAD_RELEASE_PDB". When I disable it I still get a proper debug build and for releases I save space because I don't need the PDBs. But I guess I have a thinko, right? So why is FREECAD_RELEASE_PDB by default on?
* compiling the INSTALL target, I see that we copy these files
bin\swig\Examples
do we really need them? If not we save almost 5000 files and this speeds up the installer build process a lot (the Zipping of the files)
(the same is with bin\swig\Doc)
questions regarding the INSTALL Cmake target
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: questions regarding the INSTALL Cmake target
OK, these are really not necessary and I removed them now from the LibPack for FreeCAD 0.20.
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: questions regarding the INSTALL Cmake target
does this affect only the libpack or other platforms too?
Re: questions regarding the INSTALL Cmake target
This is a CMake option available on all platforms.adrianinsaval wrote: ↑Fri May 27, 2022 2:49 am does this affect only the libpack or other platforms too?
Re: questions regarding the INSTALL Cmake target
FREECAD_RELEASE_PDB activates minimal debug information for a release build. It doesn't affect the speed (like a real debug build would do) and at the same time can be very useful to locate crashes in FreeCAD code.
In case FreeCAD crashes a crash.dmp file will be created that can be loaded with VS and if you have the corresponding PDB files plus the source code of that version you can debug through the code. Without the PDB files it's not possible to debug the code and all what the debugger shows is the name of the DLL where the crash has occurred.
However, the PDB files don't need to be part of the installer. It would be sufficient to add them to a ZIP file and provide it as a separate file.
No, they are not needed. swig is only needed to generate a header file that allows access to the C/C++ part of pivy.bin\swig\Examples
do we really need them? If not we save almost 5000 files and this speeds up the installer build process a lot (the Zipping of the files)
(the same is with bin\swig\Doc)
Re: questions regarding the INSTALL Cmake target
Many thanks. I documented this info how:
https://wiki.freecadweb.org/Compile_on_ ... ld_process
For the installer I excluded now the PDB. I think users who like to debug also have a build system that they can compile FC on their own. This way, they can recompile it with release PDBs.
Re: questions regarding the INSTALL Cmake target
No, this option is only available if MSVC is set.uwestoehr wrote: ↑Fri May 27, 2022 3:17 amThis is a CMake option available on all platforms.adrianinsaval wrote: ↑Fri May 27, 2022 2:49 am does this affect only the libpack or other platforms too?
In cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake:
Code: Select all
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
if(MSVC)
option(FREECAD_RELEASE_PDB "Create PDB files for Release version." ON)
Code: Select all
if(MSVC)
# set default compiler settings
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zm150 /bigobj")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG /Zm150 /bigobj")
# set default libs
set (CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib SHFolder.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib comsupp.lib Ws2_32.lib dbghelp.lib ")
set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}")
# set linker flag /nodefaultlib
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
if(FREECAD_RELEASE_PDB)