CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2024-03-04T16:17:27-05:00https://gitlab.kitware.com/cmake/cmake/-/issues/25737GHS: custom_command with multiple outputs executes multiple times2024-03-04T16:17:27-05:00William SciaroniGHS: custom_command with multiple outputs executes multiple times# Background
- Using CMake with the `Green Hills MULTI" generator
With the following configuration:
```cmake
cmake_minimum_required(VERSION 3.27)
project(Example LANGUAGES CXX)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/...# Background
- Using CMake with the `Green Hills MULTI" generator
With the following configuration:
```cmake
cmake_minimum_required(VERSION 3.27)
project(Example LANGUAGES CXX)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/one.cpp ${CMAKE_CURRENT_BINARY_DIR}/two.cpp
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/one.cpp ${CMAKE_CURRENT_BINARY_DIR}/two.cpp
COMMENT "GENERATING one.cpp and two.cpp"
)
add_library(SomeLib ${CMAKE_CURRENT_BINARY_DIR}/one.cpp ${CMAKE_CURRENT_BINARY_DIR}/two.cpp)
```
The generation output is similar to the following
```log
Building ALL_BUILD.tgt.gpj
Processing Custom Rule SomeLib_cc0_one.cpp.rule.sh because one.cpp does not exist
GENERATING one.cpp and two.cpp
Processing Custom Rule SomeLib_cc0_one.cpp.rule.sh because two.cpp does not exist
GENERATING one.cpp and two.cpp
Compiling one.cpp because it has changed
Compiling two.cpp because it has changed
Archiving libSomeLib.a because two.o has changed
Done
```https://gitlab.kitware.com/cmake/cmake/-/issues/19785GHS: CMake testing exercises GHS generator differently from how the other gen...2021-11-30T10:40:27-05:00Fred BaksikGHS: CMake testing exercises GHS generator differently from how the other generators get exercisedThe way that CMake testing is setup it exercises CMake and a generator based on how CMake itself was built. Since GHS is essentially a cross compiler it is never used for building CMake and there are only a few tests that get run when t...The way that CMake testing is setup it exercises CMake and a generator based on how CMake itself was built. Since GHS is essentially a cross compiler it is never used for building CMake and there are only a few tests that get run when the GHS generator is active. Most of the tests are run when a different generator is being used.
Now that GHS generator supports custom targets and commands GHS generator can support a much larger set of the standard tests that are run for each generator. Some of the standard tests may need be updated to pass in GHS specific settings to work. Other tests may need to be bypassed as they may not make much sense or won't work because they use third party libraries that are not available in a cross-target environment.Fred BaksikFred Baksikhttps://gitlab.kitware.com/cmake/cmake/-/issues/19743GHS-MULTI: Enable compiler with Ninja and Makefile generators2022-09-24T07:34:23-04:00Brad KingGHS-MULTI: Enable compiler with Ninja and Makefile generatorsAccording to https://gitlab.kitware.com/cmake/cmake/merge_requests/3839#note_629414 it is possible to use these generators with the GHS compiler by always passing `-bsp ...` and `-os_dir ...` arguments. We have other platforms where we ...According to https://gitlab.kitware.com/cmake/cmake/merge_requests/3839#note_629414 it is possible to use these generators with the GHS compiler by always passing `-bsp ...` and `-os_dir ...` arguments. We have other platforms where we add necessary arguments to compilers automatically based on configurable settings rather than asking users to pass flags themselves. We should consider doing that for GHS-MULTI too.
It could be done in `Modules/Platform/GHS-MULTI-GHS-{C,CXX}.cmake` modules.Fred BaksikFred Baksikhttps://gitlab.kitware.com/cmake/cmake/-/issues/18772GHS: Integrity Applications should not use C / CXX language flags2019-01-09T12:00:20-05:00Fred BaksikGHS: Integrity Applications should not use C / CXX language flagsIntegrity Applications are implemented as an executable. They take other executable targets and bundles them together using an integrate file. It requires the ability of setting options to the integrate tool. But it shouldn't follow t...Integrity Applications are implemented as an executable. They take other executable targets and bundles them together using an integrate file. It requires the ability of setting options to the integrate tool. But it shouldn't follow the conventions of being a `C` / `CXX` application.Fred BaksikFred Baksikhttps://gitlab.kitware.com/cmake/cmake/-/issues/16911GHS - Multi7 and Integrity IOT compatability2024-02-01T09:21:08-05:00Fred BaksikGHS - Multi7 and Integrity IOT compatabilityOne of the features of Multi7 and GHS compilers 2015.1 and newer is that it allows for multiple configurations to be chosen to be built. For the BSP that I am using the choices are Debug / Checked / Release. This in turn picks which opt...One of the features of Multi7 and GHS compilers 2015.1 and newer is that it allows for multiple configurations to be chosen to be built. For the BSP that I am using the choices are Debug / Checked / Release. This in turn picks which option files to use and include in the top-level project. One of the items that is set is the build directory location and where object files are stored after generation. This conflicts with the current ``Green Hills MULTI`` generator that hard codes the object file output in the sub-projects.https://gitlab.kitware.com/cmake/cmake/-/issues/16902GHS: Quoting issues when using target_compile_options() and add_custom_command()2022-07-21T18:54:36-04:00Fred BaksikGHS: Quoting issues when using target_compile_options() and add_custom_command()When using the command in the CMakeLists.txt file
> target_compile_options(my_target
BEFORE PRIVATE
:optionsFile=\${__OPTIONDEFS}/full_c_vas_program.opt
)
the generated output was
> :optionsFile=\$${__OPTIONDEFS}/full_c_vas_pro...When using the command in the CMakeLists.txt file
> target_compile_options(my_target
BEFORE PRIVATE
:optionsFile=\${__OPTIONDEFS}/full_c_vas_program.opt
)
the generated output was
> :optionsFile=\$${__OPTIONDEFS}/full_c_vas_program.opt
I was expecting it to be
>:optionsFile=${__OPTIONDEFS}/full_c_vas_program.opt
I traced to several lines of code in ``cmOutputConverter.cxx`` where it was performing ``Makefile`` quoting. I adapted the file to not perform any special quoting when using the GHS Multi generator.
#16488 Feature 4 and Feature 5 included patches for fixing `add_custom_command()`.Fred BaksikFred Baksik