mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
Change approach
This commit is contained in:
parent
74d0924bcb
commit
4a40835f71
1 changed files with 23 additions and 9 deletions
|
@ -156,12 +156,6 @@ function(setup_geode_mod proname)
|
||||||
set(INSTALL_ARG "--install")
|
set(INSTALL_ARG "--install")
|
||||||
endif()
|
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
|
# The lib binary should be passed only if some headers were provided
|
||||||
if (MOD_HAS_API)
|
if (MOD_HAS_API)
|
||||||
message(STATUS "Including library & headers with ${proname}")
|
message(STATUS "Including library & headers with ${proname}")
|
||||||
|
@ -170,12 +164,12 @@ function(setup_geode_mod proname)
|
||||||
set(HAS_HEADERS Off)
|
set(HAS_HEADERS Off)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (HAS_HEADERS AND WIN32)
|
if (GEODE_BUNDLE_PDB AND WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
|
||||||
# this adds the .lib file on windows, which is needed for linking with the headers
|
if (HAS_HEADERS)
|
||||||
add_custom_target(${proname}_PACKAGE ALL
|
add_custom_target(${proname}_PACKAGE ALL
|
||||||
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
|
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
|
||||||
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
|
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
--binary $<TARGET_FILE:${proname}> $<TARGET_LINKER_FILE:${proname}>
|
--binary $<TARGET_FILE:${proname}> $<TARGET_LINKER_FILE:${proname}> $<TARGET_PDB_FILE:${proname}>
|
||||||
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
||||||
${INSTALL_ARG} ${PDB_ARG}
|
${INSTALL_ARG} ${PDB_ARG}
|
||||||
VERBATIM USES_TERMINAL
|
VERBATIM USES_TERMINAL
|
||||||
|
@ -184,12 +178,32 @@ function(setup_geode_mod proname)
|
||||||
add_custom_target(${proname}_PACKAGE ALL
|
add_custom_target(${proname}_PACKAGE ALL
|
||||||
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
|
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
|
||||||
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
|
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
--binary $<TARGET_FILE:${proname}>
|
--binary $<TARGET_FILE:${proname}> $<TARGET_PDB_FILE:${proname}>
|
||||||
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
||||||
${INSTALL_ARG} ${PDB_ARG}
|
${INSTALL_ARG} ${PDB_ARG}
|
||||||
VERBATIM USES_TERMINAL
|
VERBATIM USES_TERMINAL
|
||||||
)
|
)
|
||||||
endif()
|
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 $<TARGET_FILE:${proname}> $<TARGET_LINKER_FILE:${proname}>
|
||||||
|
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
||||||
|
${INSTALL_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 $<TARGET_FILE:${proname}>
|
||||||
|
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
|
||||||
|
${INSTALL_ARG}
|
||||||
|
VERBATIM USES_TERMINAL
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add dependency dir to include path
|
# Add dependency dir to include path
|
||||||
if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/geode-deps")
|
if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/geode-deps")
|
||||||
|
|
Loading…
Reference in a new issue