Skip to content

Commit ca616a0

Browse files
committed
fix: force C99 for lp_solve dependency
1 parent 410a90f commit ca616a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

external/cmake-files/LPSolve.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,16 @@ endif(NOT APPLE)
7171
${LP_SOLVE_DIR}/lp_utils.c
7272
${LP_SOLVE_DIR}/lp_wlp.c)
7373

74+
# Force lp_solve to be compiled as pure C (not C++)
75+
set_target_properties(lp_solve PROPERTIES
76+
LINKER_LANGUAGE C
77+
C_STANDARD 99
78+
C_STANDARD_REQUIRED YES
79+
)
80+
81+
# Remove accidental C++ flags
82+
target_compile_options(lp_solve PRIVATE
83+
$<$<COMPILE_LANGUAGE:C>:-std=c99>
84+
)
85+
7486
endfunction()

0 commit comments

Comments
 (0)