diff --git a/CMakeLists.txt b/CMakeLists.txt index 6580e26806..38486b6996 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,6 +253,13 @@ add_custom_target( all-generators COMMENT "meta target which depends on all generators" ) + +if(CMAKE_HOST_WIN32) + set(CMAKE_HOST_EXECUTABLE_SUFFIX ".exe") +else() + set(CMAKE_HOST_EXECUTABLE_SUFFIX "") +endif() + set_target_properties(all-generators PROPERTIES FOLDER generators) function(generator dir) if(SLANG_GENERATORS_PATH) @@ -267,7 +274,7 @@ function(generator dir) TARGET ${target} PROPERTY IMPORTED_LOCATION - "${SLANG_GENERATORS_PATH}/${target}${CMAKE_EXECUTABLE_SUFFIX}" + "${SLANG_GENERATORS_PATH}/${target}${CMAKE_HOST_EXECUTABLE_SUFFIX}" ) else() slang_add_target(