From 74d0924bcb3e19e014fd049a19ae0a8430e16c53 Mon Sep 17 00:00:00 2001 From: Justin <52604018+hiimjustin000@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:20:30 -0500 Subject: [PATCH 1/2] Part 2: Geode SDK --- cmake/GeodeFile.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index 143b8f93..6e002f16 100644 --- a/cmake/GeodeFile.cmake +++ b/cmake/GeodeFile.cmake @@ -156,6 +156,12 @@ function(setup_geode_mod proname) set(INSTALL_ARG "--install") endif() + if (GEODE_BUNDLE_PDB AND WIN32) + set(PDB_ARG "--pdb") + else() + set(PDB_ARG "") + endif() + # The lib binary should be passed only if some headers were provided if (MOD_HAS_API) message(STATUS "Including library & headers with ${proname}") @@ -171,7 +177,7 @@ function(setup_geode_mod proname) COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} --binary $ $ --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode - ${INSTALL_ARG} + ${INSTALL_ARG} ${PDB_ARG} VERBATIM USES_TERMINAL ) else() @@ -180,7 +186,7 @@ function(setup_geode_mod proname) COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} --binary $ --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode - ${INSTALL_ARG} + ${INSTALL_ARG} ${PDB_ARG} VERBATIM USES_TERMINAL ) endif() From 4a40835f71cd04355bb99493d694b0a7d80db138 Mon Sep 17 00:00:00 2001 From: Justin <52604018+hiimjustin000@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:23:18 -0500 Subject: [PATCH 2/2] Change approach --- cmake/GeodeFile.cmake | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index 6e002f16..a0ee0a0a 100644 --- a/cmake/GeodeFile.cmake +++ b/cmake/GeodeFile.cmake @@ -156,12 +156,6 @@ function(setup_geode_mod proname) set(INSTALL_ARG "--install") endif() - if (GEODE_BUNDLE_PDB AND WIN32) - set(PDB_ARG "--pdb") - else() - set(PDB_ARG "") - endif() - # The lib binary should be passed only if some headers were provided if (MOD_HAS_API) message(STATUS "Including library & headers with ${proname}") @@ -170,14 +164,34 @@ function(setup_geode_mod proname) set(HAS_HEADERS Off) endif() - if (HAS_HEADERS AND WIN32) + if (GEODE_BUNDLE_PDB AND WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) + if (HAS_HEADERS) + add_custom_target(${proname}_PACKAGE ALL + DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json + COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} + --binary $ $ $ + --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode + ${INSTALL_ARG} ${PDB_ARG} + VERBATIM USES_TERMINAL + ) + else() + add_custom_target(${proname}_PACKAGE ALL + DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json + COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} + --binary $ $ + --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode + ${INSTALL_ARG} ${PDB_ARG} + VERBATIM USES_TERMINAL + ) + endif() + elseif (HAS_HEADERS AND WIN32) # this adds the .lib file on windows, which is needed for linking with the headers add_custom_target(${proname}_PACKAGE ALL DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} --binary $ $ --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode - ${INSTALL_ARG} ${PDB_ARG} + ${INSTALL_ARG} VERBATIM USES_TERMINAL ) else() @@ -186,7 +200,7 @@ function(setup_geode_mod proname) COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR} --binary $ --output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode - ${INSTALL_ARG} ${PDB_ARG} + ${INSTALL_ARG} VERBATIM USES_TERMINAL ) endif()