Fix output compilation options for bindings.

This commit is contained in:
Ryan Curtin
2022-09-15 09:55:43 -04:00
parent 50a5387245
commit be1e9ccaea
5 changed files with 17 additions and 3 deletions
@@ -14,6 +14,11 @@
#include <Rcpp.h>
#undef MLPACK_PRINT_INFO
#define MLPACK_PRINT_INFO
#undef MLPACK_PRINT_WARN
#define MLPACK_PRINT_WARN
// Rcpp has its own stream object which cooperates more nicely with R's i/o
// And as of armadillo and mlpack, we can use this stream object as well.
#if !defined(ARMA_COUT_STREAM)
+1 -1
View File
@@ -20,7 +20,7 @@ if (BUILD_CLI_EXECUTABLES)
# Make sure that we set BINDING_TYPE to cli so the command-line program is
# compiled with the correct int main() call.
set_target_properties(mlpack_${name} PROPERTIES COMPILE_FLAGS
-DBINDING_TYPE=BINDING_TYPE_CLI)
-DBINDING_TYPE=BINDING_TYPE_CLI -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN)
install(TARGETS mlpack_${name} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
# If man documentation is being generated, make sure this is a dependency.
+6 -1
View File
@@ -141,7 +141,10 @@ if (BUILD_GO_SHLIB)
${CMAKE_SOURCE_DIR}/src/mlpack/bindings/go/mlpack/capi/arma_util.cpp
${CMAKE_SOURCE_DIR}/src/mlpack/bindings/go/mlpack/capi/io_util.cpp)
target_link_libraries(mlpack_go_util ${MLPACK_LIBRARIES})
target_compile_definitions(mlpack_go_util PUBLIC "BINDING_TYPE=BINDING_TYPE_GO")
target_compile_definitions(mlpack_go_util PUBLIC
-DBINDING_TYPE=BINDING_TYPE_GO
-DMLPACK_PRINT_INFO
-DMLPACK_PRINT_WARN)
set_target_properties(mlpack_go_util PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/)
@@ -240,6 +243,8 @@ if(BUILD_GO_SHLIB)
add_library(mlpack_go_${name} SHARED
${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/build/${name}.cpp)
target_link_libraries(mlpack_go_${name} mlpack_go_util)
target_compile_definitions(mlpack_go_${name} PUBLIC
-DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN)
set_target_properties(mlpack_go_${name} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/")
+4
View File
@@ -54,6 +54,8 @@ if (BUILD_JULIA_BINDINGS)
julia_util.h
julia_util.cpp)
target_link_libraries(mlpack_julia_util ${MLPACK_LIBRARIES})
target_compile_definitions(mlpack_julia_util PUBLIC
-DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN)
set_target_properties(mlpack_julia_util PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/src/")
add_dependencies(julia mlpack_julia_util)
@@ -188,6 +190,8 @@ if (BUILD_JULIA_BINDINGS)
${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/build/julia_${name}.h
${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/build/julia_${name}.cpp)
target_link_libraries(mlpack_julia_${name} mlpack_julia_util)
target_compile_definitions(mlpack_julia_${name} PUBLIC
-DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN)
set_target_properties(mlpack_julia_${name} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/src/")
+1 -1
View File
@@ -26,7 +26,7 @@ macro (post_python_bindings)
-D OpenMP_CXX_FLAGS="${OpenMP_CXX_FLAGS}"
-D DISABLE_CFLAGS="${DISABLE_CFLAGS}"
-D CYTHON_INCLUDE_DIRECTORIES="${CYTHON_INCLUDE_DIRECTORIES}"
-D CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-D CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN"
-D OUTPUT_DIR=${CMAKE_BINARY_DIR}
-P "${CMAKE_SOURCE_DIR}/CMake/ConfigureFile.cmake"
BYPRODUCTS "${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/setup.py"