Enhance CMake configuration for Windows builds

- Added conditional linking of the Windows resource file for x64 architecture in `CMakeLists.txt`, improving build specificity for Windows targets.
- This change ensures that the resource file is only linked when building for 64-bit Windows, enhancing the project's compatibility and build process.
This commit is contained in:
scawful
2025-09-28 18:10:36 -04:00
parent 72dbfc537f
commit 831a8dcb82

View File

@@ -112,13 +112,18 @@ else()
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
) )
else() else()
# Windows resource file - only for x64 architecture
set_target_properties(yaze set_target_properties(yaze
PROPERTIES PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
LINK_FLAGS "${CMAKE_CURRENT_SOURCE_DIR}/win32/yaze.res"
) )
# Only use resource file for x64 Windows builds
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
target_link_options(yaze PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/win32/yaze.res")
endif()
endif() endif()
endif() endif()