@@ -32,67 +32,3 @@ add_custom_command(TARGET TorchLoad POST_BUILD
3232set_target_properties (TorchLoad PROPERTIES
3333 RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
3434)
35-
36-
37- # # === 1) The helper-function:
38- # function(chpl_add_executable TARGET MAIN_CHPL)
39- # add_executable(${TARGET}
40- # ${MAIN_CHPL}
41- # ${CHAI_LIB_FILES}
42- # )
43-
44- # add_dependencies(${TARGET}
45- # bridge
46- # ChAI
47- # bridge_objs
48- # TorchBridge
49- # )
50-
51- # get_filename_component(_main_base ${MAIN_CHPL} NAME)
52-
53- # set(_module_dirs "${PROJECT_ROOT_DIR}/lib")
54- # if(ARGN)
55- # list(APPEND _module_dirs ${ARGN})
56- # endif()
57-
58- # set(_m_flags "")
59- # foreach(_d IN LISTS _module_dirs)
60- # list(APPEND _m_flags "-M" "${_d}")
61- # endforeach()
62-
63- # target_link_options(${TARGET}
64- # PRIVATE
65- # --main-module ${_main_base}
66- # ${_m_flags}
67- # ${CHAI_LINKER_ARGS}
68- # )
69- # endfunction()
70-
71-
72-
73-
74- #
75- # Updated chpl_add_executable:
76- #
77-
78-
79-
80-
81- # === 3) Replace TorchLoad:
82- # Suppose TorchLoad also needs an additional module directory at
83- # ${PROJECT_ROOT_DIR}/torch_extra_modules:
84- chai_add_executable (TorchLoad2
85- ${CMAKE_CURRENT_SOURCE_DIR} /torch_load.chpl
86- ${PROJECT_ROOT_DIR} /lib
87- )
88-
89- # Then re‐attach the “copy tensors” step and RUNTIME_OUTPUT_DIRECTORY:
90- add_custom_command (TARGET TorchLoad2 POST_BUILD
91- COMMAND ${CMAKE_COMMAND} -E copy_directory
92- "${CMAKE_CURRENT_SOURCE_DIR} /tensors"
93- "${CMAKE_BINARY_DIR} /examples/TorchLoad/tensors"
94- COMMENT "Copying tensor folder"
95- )
96- set_target_properties (TorchLoad2 PROPERTIES
97- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
98- )
0 commit comments