questions regarding the INSTALL Cmake target

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

questions regarding the INSTALL Cmake target

Post by uwestoehr »

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)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: questions regarding the INSTALL Cmake target

Post by uwestoehr »

uwestoehr wrote: Thu May 26, 2022 6:38 pm * 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)
OK, these are really not necessary and I removed them now from the LibPack for FreeCAD 0.20.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: questions regarding the INSTALL Cmake target

Post by adrianinsaval »

does this affect only the libpack or other platforms too?
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: questions regarding the INSTALL Cmake target

Post by uwestoehr »

adrianinsaval wrote: Fri May 27, 2022 2:49 am does this affect only the libpack or other platforms too?
This is a CMake option available on all platforms.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: questions regarding the INSTALL Cmake target

Post by wmayer »

uwestoehr wrote: Thu May 26, 2022 6:38 pm * 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?
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.
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)
No, they are not needed. swig is only needed to generate a header file that allows access to the C/C++ part of pivy.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: questions regarding the INSTALL Cmake target

Post by uwestoehr »

wmayer wrote: Fri May 27, 2022 6:01 am FREECAD_RELEASE_PDB activates minimal debug information for a release build....

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.
User avatar
waebbl
Posts: 200
Joined: Thu Aug 16, 2018 3:12 pm

Re: questions regarding the INSTALL Cmake target

Post by waebbl »

uwestoehr wrote: Fri May 27, 2022 3:17 am
adrianinsaval wrote: Fri May 27, 2022 2:49 am does this affect only the libpack or other platforms too?
This is a CMake option available on all platforms.
No, this option is only available if MSVC is set.

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)
and in cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake

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)
There are no other occurences of the symbol in any CMake related file (CMakeLists.txt or *.cmake)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: questions regarding the INSTALL Cmake target

Post by uwestoehr »

waebbl wrote: Sat May 28, 2022 12:24 pm No, this option is only available if MSVC is set.
You are right, I mixed this up with a CMake option of OCC which I was dealing with the same time.

Sorry and regards
Uwe
Post Reply