From 5fa6caad8f87be3476760178828176c2898ae6e0 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 18 Nov 2024 18:48:19 -0600 Subject: [PATCH] Fix (another) TypeError when CMAKE_GENERATOR isn't present Follow-up to 6c4985ba4cc0020ffbb4d2f357387917db1f121f Follow-up to 82bed70bb9ed981d70d45bd22d70ed3632dc9733 --- colcon_cmake/task/cmake/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/colcon_cmake/task/cmake/__init__.py b/colcon_cmake/task/cmake/__init__.py index f38c62e..ec6257c 100644 --- a/colcon_cmake/task/cmake/__init__.py +++ b/colcon_cmake/task/cmake/__init__.py @@ -109,10 +109,11 @@ def get_buildfile(cmake_cache): """ generator = get_variable_from_cmake_cache( str(cmake_cache.parent), 'CMAKE_GENERATOR') - if generator and 'Ninja' in generator: - return cmake_cache.parent / 'build.ninja' - if 'Visual Studio' in generator: - return cmake_cache.parent / 'ALL_BUILD.vcxproj' + if generator is not None: + if 'Ninja' in generator: + return cmake_cache.parent / 'build.ninja' + if 'Visual Studio' in generator: + return cmake_cache.parent / 'ALL_BUILD.vcxproj' return cmake_cache.parent / 'Makefile'