mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-31 20:23:26 +02:00

Summary: - Add some new API to make it easier for ISVs to provide defaults. - Fully connect UI elements to CMake build process - Add some missing UI elements (such as customizing generator) - CMake generator default within CDT changed to Ninja Details: Add API to set CMake generator default (eg Ninja) ISV can set their desired CMake generator by overriding `CMakeBuildConfiguration.getDefaultProperties`. ISVs can also further fine tune the build process by overriding `CMakeBuildConfiguration.getDefaultProperties` Remove API `IOsOverrides` and related code. `IOsOverrides` was a partial implementation to achieve builds in Docker containers, however the work was not complete and it the extra code was complicating some basic use cases of setting defaults Add support for all generators to CMake build settings UI page by using a Combo instead of radio buttons. The non-deprecated generators that are built-in to CDT populate the Combo, but additional generators can be manually entered in the Combo. Rename clean command to clean target to better reflect its use as the argument passed to cmake's --target command line. Add all target for the argument passed to cmake's --target command line when doing a normal build. Clarify usage of UI overrides and change the UI to be "use defaults" (i.e. invert the checkbox). This is a **breaking** change as it means user projects that were using UI overrides will revert to using defaults. This is done on purpose as so many little things have changed in CMake settings, that reverting to defaults on upgrade seems like a logical decision. In addition *use defaults* matches the other GUIs in Eclipse, for example the MBS build command settings. Populate all defaults in getDefaultProperties() so that all CMake build settings are displayed as used (greyed out) and can be used as a starting point when editing settings. Simplify some of the code in CMakeBuildTab. Fix parsing of extra args so that quoted strings work. Refactored manual tests document and brought it up to date. Correct command line option for CMake's --warn-unused-vars Correct command line option for CMake's --warn-uninitialized Overall this is an API breaking change and the CHANGELOG-API.md has been updated with all the API changes in and around ICMakeProperties, including fixing typos in WarnUninitialized methods. Fixes #1055 Fixes #818 Part of #1000 Co-authored-by: Jonah Graham <jonah@kichwacoders.com>
12 KiB
12 KiB
Test Execution
The tests were run on 20240129 Windows 10. All tests pass. This document captures some of the results for future developers to have a valuable comparison point.
Setup
Create CMake Project called helloworld.
1) Operating system defaults used
1.1) Launch Bar Launch Mode=Run, CMake Settings > "Use these settings"=unchecked
- Set Launch Bar Launch Mode to Run.
- Set CMake Settings > "Use these settings" to unchecked.
- On the Launch Bar, click Build button.
Expected: Build uses default generator (win32: -G MinGW Makefiles)
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
cmake -G MinGW Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (3.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/default
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
cmake --build . --target all
[ 50%] Building CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj
[100%] Linking CXX executable helloworld.exe
[100%] Built target helloworld
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
1.2) Launch Bar Launch Mode=Debug, CMake Settings > "Use these settings"=unchecked
- Set Launch Bar Launch Mode to Debug.
- Make sure CMake Settings > "Use these settings" to unchecked.
- On the Launch Bar, click Build button.
Expected: Build uses default generator (win32: -G MinGW Makefiles)
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake -G MinGW Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.8s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/cmake.debug.win32.x86_64
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake --build . --target all
[ 50%] Building CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj
[100%] Linking CXX executable helloworld.exe
[100%] Built target helloworld
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
2) Build Settings specific generator used:
2.1) Launch Bar Launch Mode=Run, CMake Settings > Use these settings=checked, Generator=Ninja
- Set Launch Bar Launch Mode to Run.
- Set CMake Settings > "Use these settings" to checked.
- Make sure CMake Settings > Generator is set to Ninja.
- In Project Explorer, delete the build directory.
- On the Launch Bar, click Build button.
Expected: Build uses generator Ninja
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.3s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/default
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
cmake --build . --target all
[1/2] Building CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj
[2/2] Linking CXX executable helloworld.exe
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\default
2.2) Launch Bar Launch Mode=Debug, CMake Settings > Use these settings=checked, Generator=Unix Makefiles
- Set Launch Bar Launch Mode to Debug.
- Set CMake Settings > "Use these settings" to checked.
- Make sure CMake Settings > Generator is set to Unix Makefiles.
- On the Launch Bar, click Build button.
Expected: Build uses generator Unix Makefiles
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake -G Unix Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (3.3s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/cmake.debug.win32.x86_64
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake --build . --target all
[ 50%] [32mBuilding CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj[0m
[100%] [32m[1mLinking CXX executable helloworld.exe[0m
[100%] Built target helloworld
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
2.3) Build Settings are remembered
- With Launch Bar Launch Mode still set to Debug.
- Open CMake Settings > "Use these settings".
Expected:
checked.
Actual:
checked.
2.4) Build Settings for Run mode can be different to settings stored for Debug
- Make sure Launch Bar Launch Mode still set to Debug.
- Set CMake Settings > "Use these settings" to unchecked.
- Set Launch Bar Launch Mode to Run.
- Open CMake Settings > "Use these settings".
Expected:
checked.
Actual:
checked.
- Set Launch Bar Launch Mode to Debug.
- Open CMake Settings > "Use these settings".
Expected:
unchecked.
Actual:
unchecked.
3) Build Settings specific Additional CMake arguments:
3.1) CMake Settings > Use these settings=checked, Additional CMake arguments are used during build
- Make sure Launch Bar Launch Mode still set to Debug.
- Set CMake Settings > "Use these settings" to checked.
- Set CMake Settings > Generator to Ninja.
- Set CMake Settings > "Additional CMake arguments" to "-DVAR=TEST"
- On the Launch Bar, click Build button.
Expected: args in "Additional CMake arguments" are used during build.
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake -G Ninja -DVAR=TEST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.4s)
-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:
VAR
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/cmake.debug.win32.x86_64
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake --build . --target all
[1/2] Building CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj
[2/2] Linking CXX executable helloworld.exe
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
3.2) CMake Settings > Use these settings=unchecked, Additional CMake arguments are NOT used during build
- Make sure Launch Bar Launch Mode still set to Debug.
- Set CMake Settings > "Use these settings" to unchecked.
- On the Launch Bar, click Build button.
Expected: args in "Additional CMake arguments" are NOT used during build.
Actual:
Configuring in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake -G MinGW Makefiles -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.5s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/betamax/cdt-only2/runtime-New_configuration(1)/helloworld/build/cmake.debug.win32.x86_64
Building in: C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64
cmake --build . --target all
[ 50%] Building CXX object CMakeFiles/helloworld.dir/helloworld.cpp.obj
[100%] Linking CXX executable helloworld.exe
[100%] Built target helloworld
Build complete (0 errors, 0 warnings): C:\Users\betamax\cdt-only2\runtime-New_configuration(1)\helloworld\build\cmake.debug.win32.x86_64