fgerlits commented on code in PR #1734:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1734#discussion_r1522822212


##########
CMakeLists.txt:
##########
@@ -493,20 +504,21 @@ if(WIN32)
             list(GET VCRUNTIME_X64_MERGEMODULES 0 
VCRUNTIME_X64_MERGEMODULE_PATH)
         endif()
 
-        if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        if (BUILD_PLATFORM STREQUAL "x64")
             message("Using ${VCRUNTIME_X64_MERGEMODULE_PATH} VC 
Redistributable Merge Module")
             configure_file("msi/x64.wsi" "msi/x64.wsi" @ONLY)
             list(APPEND CPACK_WIX_EXTRA_SOURCES 
"${CMAKE_CURRENT_BINARY_DIR}/msi/x64.wsi")
-        elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+        else()
             message("Using ${VCRUNTIME_X86_MERGEMODULE_PATH} VC 
Redistributable Merge Module")
             configure_file("msi/x86.wsi" "msi/x86.wsi" @ONLY)
             list(APPEND CPACK_WIX_EXTRA_SOURCES 
"${CMAKE_CURRENT_BINARY_DIR}/msi/x86.wsi")
-        else()
-            message(FATAL_ERROR "Could not determine architecture, 
CMAKE_SIZEOF_VOID_P is unexpected: ${CMAKE_SIZEOF_VOID_P}")
         endif()
-        set(CPACK_WIX_TEMPLATE 
"${CMAKE_CURRENT_SOURCE_DIR}/msi/WixWinMergeModules.wsi")
-    else()
-        message("Creating installer with redistributables")
+
+        file(READ "${CMAKE_CURRENT_SOURCE_DIR}/msi/MergeModulesFeature.xml" 
WIX_EXTRA_FEATURES)
+        configure_file("${CMAKE_CURRENT_SOURCE_DIR}/msi/WixWin.wsi.in" 
"${CMAKE_CURRENT_SOURCE_DIR}/msi/WixWin.wsi")
+        set(CPACK_WIX_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/msi/WixWin.wsi")

Review Comment:
   these two lines are the same in every branch, so they could be moved to 
after the `if` block



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to