From e30047ca2f01c868d2c1656e5b4c191f28f69d6c Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Thu, 2 Jan 2025 07:33:39 -0300 Subject: [PATCH] fix missing icon in executable the Ja2.rc file needs to be in the add_executable target for the icon to appear, and that one requires WinMain. so get rid of dummy.cpp and put sgp/sgp.cpp in there --- .gitignore | 2 -- CMakeLists.txt | 6 ++++-- Ja2/CMakeLists.txt | 1 - sgp/CMakeLists.txt | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5ef609a70..6466f05cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -dummy.cpp - # CLion /.idea/ /cmake-build-*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f6427904..532067ab5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,8 +139,10 @@ foreach(app IN LISTS ApplicationTargets) foreach(lang IN LISTS LangTargets) # executable for an application/language combination, e.g. JA2_ENGLISH.exe set(exe ${app}_${lang}) - file(WRITE dummy.cpp "") - add_executable(${exe} WIN32 dummy.cpp) + add_executable(${exe} WIN32 + sgp/sgp.cpp + Ja2/Res/Ja2.rc + ) target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $) target_link_options(${exe} PRIVATE $) diff --git a/Ja2/CMakeLists.txt b/Ja2/CMakeLists.txt index c990339d8..9b798987b 100644 --- a/Ja2/CMakeLists.txt +++ b/Ja2/CMakeLists.txt @@ -34,5 +34,4 @@ set(Ja2Src "${CMAKE_CURRENT_SOURCE_DIR}/XML_DifficultySettings.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_IntroFiles.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/XML_Layout_MainMenu.cpp" -${CMAKE_CURRENT_SOURCE_DIR}/Res/ja2.rc PARENT_SCOPE) diff --git a/sgp/CMakeLists.txt b/sgp/CMakeLists.txt index c1df77f34..2a493d63e 100644 --- a/sgp/CMakeLists.txt +++ b/sgp/CMakeLists.txt @@ -21,7 +21,6 @@ set(sgpSrc "${CMAKE_CURRENT_SOURCE_DIR}/PCX.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/PngLoader.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/Random.cpp" -"${CMAKE_CURRENT_SOURCE_DIR}/sgp.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/sgp_logger.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/shading.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/soundman.cpp"