Skip to content

Commit e97eeb2

Browse files
committed
Merge branch 'fix-nauty-cmake' into 'v9-minor'
fix build of static lib with nauty See merge request integer/scip!3433
2 parents cc1d7b2 + db71bb7 commit e97eeb2

File tree

4 files changed

+8
-43
lines changed

4 files changed

+8
-43
lines changed

CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ set(CMAKE_CXX_STANDARD 14)
121121
#search the selected symmetry computation program
122122
message(STATUS "Finding symmetry computation program \"${SYM}\"")
123123

124-
unset(NAUTY_TARGET)
125124
if(SYM STREQUAL "bliss" OR SYM STREQUAL "sbliss")
126125
if(SYM STREQUAL "bliss")
127126
message(STATUS "Support SYM: bliss")
@@ -174,16 +173,15 @@ elseif(SYM STREQUAL "nauty" OR SYM STREQUAL "snauty")
174173
set(SYM_LIBRARIES ${NAUTY_DIR}/nauty/nauty.a)
175174
set(SYM_PIC_LIBRARIES ${NAUTY_DIR}/nauty/nauty.a)
176175
else()
177-
add_subdirectory(src/nauty)
178-
set(SYM_PIC_LIBRARIES nauty)
179-
set(NAUTY_TARGET nauty)
176+
include_directories(src/nauty)
177+
set(sym nauty/nauty.c nauty/nautil.c nauty/nausparse.c nauty/schreier.c nauty/naurng.c)
180178
endif()
181179
if(SYM STREQUAL "nauty")
182180
message(STATUS "Support SYM: nauty")
183-
set(sym symmetry/compute_symmetry_nauty.c)
181+
set(sym ${sym} symmetry/compute_symmetry_nauty.c)
184182
elseif(SYM STREQUAL "snauty")
185183
message(STATUS "Support SYM: sassy+nauty")
186-
set(sym symmetry/compute_symmetry_sassy_nauty.cpp symmetry/build_sassy_graph.cpp)
184+
set(sym ${sym} symmetry/compute_symmetry_sassy_nauty.cpp symmetry/build_sassy_graph.cpp)
187185
# sassy needs C++-17
188186
set(CMAKE_CXX_STANDARD 17)
189187
endif()

src/CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,24 +1068,12 @@ if(SHARED)
10681068
set(ZIMPL_NEEDED 0)
10691069
target_link_libraries(libscip PRIVATE ${ZIMPL_PIC_LIBRARIES} ${LPS_PIC_LIBRARIES} ${SYM_PIC_LIBRARIES})
10701070
add_executable(scip main.c ${scipsources} ${objscipsources} ${lpisources} ${tpisources} ${symsources})
1071-
if(DEFINED NAUTY_TARGET)
1072-
target_link_libraries(scip PRIVATE ${NAUTY_TARGET})
1073-
endif()
10741071
else()
10751072
set(SOPLEX_NEEDED ${SOPLEX_FOUND})
10761073
set(ZIMPL_NEEDED ${ZIMPL_FOUND})
1077-
if(DEFINED NAUTY_TARGET)
1078-
target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES})
1079-
else()
1080-
target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES} ${SYM_LIBRARIES})
1081-
endif()
1074+
target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES} ${SYM_LIBRARIES})
10821075
add_executable(scip main.c)
1083-
if(DEFINED NAUTY_TARGET)
1084-
target_link_libraries(scip PUBLIC libscip)
1085-
target_link_libraries(scip PRIVATE ${NAUTY_TARGET})
1086-
else()
1087-
target_link_libraries(scip PUBLIC libscip)
1088-
endif()
1076+
target_link_libraries(scip PUBLIC libscip)
10891077
endif()
10901078

10911079
add_executable(SCIP::SCIP ALIAS scip)
@@ -1161,7 +1149,7 @@ install(TARGETS scip libscip EXPORT scip-targets
11611149
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
11621150

11631151
# Add all targets to the build-tree export set
1164-
export(TARGETS scip libscip ${NAUTY_TARGET}
1152+
export(TARGETS scip libscip
11651153
FILE "${PROJECT_BINARY_DIR}/scip-targets.cmake")
11661154

11671155
# make soplex and zimpl dir absolute for the config file

src/nauty/CMakeLists.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/nauty/naurng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ran_init_time(unsigned long long extra)
8787
}
8888

8989
unsigned long long
90-
ran_nextran()
90+
ran_nextran(void) /*SV added void*/
9191
/* Make a 64-bit random number */
9292
{
9393
return KISS;

0 commit comments

Comments
 (0)