gemini-code-assist[bot] commented on code in PR #114:
URL: https://github.com/apache/tvm-ffi/pull/114#discussion_r2427917570


##########
CMakeLists.txt:
##########
@@ -132,6 +131,29 @@ target_link_libraries(tvm_ffi_objs PUBLIC tvm_ffi_header)
 target_link_libraries(tvm_ffi_shared PUBLIC tvm_ffi_header)
 target_link_libraries(tvm_ffi_static PUBLIC tvm_ffi_header)
 
+# ######### Target: `tvm_ffi_testing` ##########
+# Build testing utilities as a separate shared library that can be loaded on 
demand
+add_library(tvm_ffi_testing SHARED 
"${CMAKE_CURRENT_SOURCE_DIR}/src/ffi/extra/testing.cc")
+target_compile_features(tvm_ffi_testing PRIVATE cxx_std_17)
+set_target_properties(
+  tvm_ffi_testing
+  PROPERTIES CXX_EXTENSIONS OFF
+             CXX_STANDARD_REQUIRED ON
+             PREFIX "lib"
+             LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   For consistency with other library targets like `tvm_ffi_shared`, it's good 
practice to also set `ARCHIVE_OUTPUT_DIRECTORY` and `RUNTIME_OUTPUT_DIRECTORY`. 
This improves robustness across different platforms.
   
   Additionally, for Windows builds using multi-config generators (like Visual 
Studio), you should also set the configuration-specific output directories to 
ensure build artifacts are placed in the correct location. This is handled for 
other targets inside the `tvm_ffi_add_target_from_obj` function.
   
   ```
   set_target_properties(
     tvm_ffi_testing
     PROPERTIES CXX_EXTENSIONS OFF
                CXX_STANDARD_REQUIRED ON
                PREFIX "lib"
                ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
                LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
                RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
   )
   ```



##########
CMakeLists.txt:
##########
@@ -132,6 +131,29 @@ target_link_libraries(tvm_ffi_objs PUBLIC tvm_ffi_header)
 target_link_libraries(tvm_ffi_shared PUBLIC tvm_ffi_header)
 target_link_libraries(tvm_ffi_static PUBLIC tvm_ffi_header)
 
+# ######### Target: `tvm_ffi_testing` ##########
+# Build testing utilities as a separate shared library that can be loaded on 
demand
+add_library(tvm_ffi_testing SHARED 
"${CMAKE_CURRENT_SOURCE_DIR}/src/ffi/extra/testing.cc")
+target_compile_features(tvm_ffi_testing PRIVATE cxx_std_17)
+set_target_properties(
+  tvm_ffi_testing
+  PROPERTIES CXX_EXTENSIONS OFF
+             CXX_STANDARD_REQUIRED ON
+             PREFIX "lib"
+             LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+)
+target_link_libraries(tvm_ffi_testing PRIVATE tvm_ffi_shared)
+target_link_libraries(tvm_ffi_testing PUBLIC tvm_ffi_header)
+tvm_ffi_add_msvc_flags(tvm_ffi_testing)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   To generate debug symbols for this library on macOS, which is useful for 
debugging and obtaining better backtraces, a call to 
`tvm_ffi_add_apple_dsymutil` should be added here, similar to how it's done for 
the `tvm_ffi_shared` target.
   
   ```
   tvm_ffi_add_msvc_flags(tvm_ffi_testing)
   tvm_ffi_add_apple_dsymutil(tvm_ffi_testing)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to