Closed rickomax closed 4 years ago
@rickomax thanks for the report! I think that the problem is the following:
cmakeListsOrSettingsJson
to CMakeListsTxtBasic
;cmakeAppendedArgs
, that is this mode is ignored, as documented: cmakeAppendedArgs:
default: ""
required: false
description: "Provides a mean to provide all the CMake arguments.
This is required when using CMakeLists.txt in Advanced mode.
For CMakeSettings.json, the arguments are already inferred, but you can append
your arguments providing them here. Used by CMakeListsTxtAdvanced and CMakeSettingsJson modes."
I think the action should be improved and warn about any argument that is being currently set by the user but disregarded at the same time during execution.
I have the same problem, by using cmakeBuildType: Release
and cmakeGenerator: VS16Win64
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_BUILD_TYPE
I see this
In the build pass, it also need passing a args --config Release
with Visual Studio or Xcode.
@iovw thanks for the report!
The problem is that run-cmake action is passing CMAKE_BUILD_TYPE
when it is not necessary (for example, when the Visual Studio generator
is being used), and CMake is then correctly reporting the warning about 'unused input'.
In order to not show the warning, you could either use CMake's Ninja generator. Also take in consideration that with using cmakeListsOrSettingsJson : CMakeListsTxtAdvanced
you can create your command line for CMake using cmakeAppendedArgs
I believe the original poster has a slightly different problem, we will find out.
This is my full command, which still doesn't work:
steps:
- uses: actions/checkout@v2
- uses: lukka/run-cmake@v0
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
useVcpkgToolchainFile: false
buildDirectory: '${{ runner.workspace }}/build/win64'
cmakeAppendedArgs: '-G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=MinSizeRel -DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_NO_EXPORT=ON -DBUILD_SHARED_LIBS=ON -DUSE_AES=OFF -DZIP_64=ON -DSKIP_INSTALL_ALL=ON -DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=ON -DSKIP_MSVC_UPDATE=ON'
The --config containing the build type part must be called on the cmake --build command which I'm not sure the location. Edit: I guess I found, testing.
It worked! I had to put it here:
buildWithCMakeArgs: '--config MinSizeRel'
If you feel like the addition of --config argument should happen automatically, let me know, i am always open to improvements. I have not put efforts around this because i would strongly suggest to use Ninja: in this case there is no need to specify the config at build time (as it is a single configuration CMake's generator).
Yeah, I think it should passing the --config argument automatically, when using Visual Studio generator and specific a cmakeBuildType.
@iovw @rickomax should be fixed now (i.e. for multi config generator the proper '--config' is passed at build time, and not CMAKE_BUILD_TYPE passed during configuration).
That's great.
Ty!
Hi!
I'm passing
-DCMAKE_BUILD_TYPE=Release
argument to thecmakeAppendedArgs
action, but CMAKE doesn't recognize it. Is there any extra step needed to make it work?