Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDL: Avoid overlinking #479

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions LDL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ project ( ldl
#-------------------------------------------------------------------------------
# find library dependencies
#-------------------------------------------------------------------------------
option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." OFF )

find_package ( SuiteSparse_config 7.2.0
PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
find_package ( SuiteSparse_config 7.2.0 REQUIRED )
endif ( )
find_package ( AMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::AMD )
find_package ( AMD 3.2.0 REQUIRED )

if ( DEMO )
find_package ( AMD 3.2.0
PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH )
if ( NOT TARGET SuiteSparse::AMD )
find_package ( AMD 3.2.0 )
endif ( )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -129,25 +133,13 @@ if ( NOT WIN32 )
endif ( )
endif ( )

target_link_libraries ( LDL PRIVATE
SuiteSparse::AMD SuiteSparse::SuiteSparseConfig )
target_include_directories ( LDL PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )

if ( NOT NSTATIC )
if ( TARGET SuiteSparse::AMD_static )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD_static )
else ( )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD )
endif ( )
if ( TARGET SuiteSparse::SuiteSparseConfig_static )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig_static )
else ( )
target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig )
endif ( )
target_include_directories ( LDL_static PUBLIC
"$<TARGET_PROPERTY:SuiteSparse::SuiteSparseConfig,INTERFACE_INCLUDE_DIRECTORIES>" )
endif ( )


#-------------------------------------------------------------------------------
# LDL installation location
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -232,7 +224,6 @@ endif ( )
# Demo library and programs
#-------------------------------------------------------------------------------

option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off )
if ( DEMO )

#---------------------------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions LDL/Config/ldl.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
#ifndef LDL_H
#define LDL_H

/* make it easy for C++ programs to include LDL */
#ifdef __cplusplus
extern "C" {
#endif

#include "SuiteSparse_config.h"

#ifdef LDL_LONG
Expand Down Expand Up @@ -47,6 +42,11 @@ extern "C" {

#endif

/* make it easy for C++ programs to include LDL */
#ifdef __cplusplus
extern "C" {
#endif

/* ========================================================================== */
/* === int32_t version ====================================================== */
/* ========================================================================== */
Expand Down Expand Up @@ -102,6 +102,10 @@ int64_t ldl_l_valid_perm (int64_t n, int64_t P [ ], int64_t Flag [ ]) ;

int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ;

#ifdef __cplusplus
}
#endif

/* ========================================================================== */
/* === LDL version ========================================================== */
/* ========================================================================== */
Expand All @@ -114,8 +118,4 @@ int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ;
#define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION)

#ifdef __cplusplus
}
#endif

#endif
18 changes: 9 additions & 9 deletions LDL/Include/ldl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
#ifndef LDL_H
#define LDL_H

/* make it easy for C++ programs to include LDL */
#ifdef __cplusplus
extern "C" {
#endif

#include "SuiteSparse_config.h"

#ifdef LDL_LONG
Expand Down Expand Up @@ -47,6 +42,11 @@ extern "C" {

#endif

/* make it easy for C++ programs to include LDL */
#ifdef __cplusplus
extern "C" {
#endif

/* ========================================================================== */
/* === int32_t version ====================================================== */
/* ========================================================================== */
Expand Down Expand Up @@ -102,6 +102,10 @@ int64_t ldl_l_valid_perm (int64_t n, int64_t P [ ], int64_t Flag [ ]) ;

int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ;

#ifdef __cplusplus
}
#endif

/* ========================================================================== */
/* === LDL version ========================================================== */
/* ========================================================================== */
Expand All @@ -114,8 +118,4 @@ int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ;
#define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION)

#ifdef __cplusplus
}
#endif

#endif