mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
prefer CMake's builtin BUILD_SHARED_LIBS option
This commit is contained in:
parent
eb6c9db857
commit
76bce1ce1c
1 changed files with 5 additions and 11 deletions
|
@ -36,9 +36,9 @@ check_include_file(poll.h HAVE_POLL_H)
|
|||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
# option(CHIBI_SCHEME_USE_DL "Use dynamic loading" ON)
|
||||
set(CHIBI_SCHEME_USE_DL OFF)
|
||||
option(CHIBI_SCHEME_SHARED "Build chibi-scheme as a shared library" ON)
|
||||
option(BUILD_SHARED_LIBS "Build chibi-scheme as a shared library" ON)
|
||||
|
||||
if(NOT CHIBI_SCHEME_SHARED)
|
||||
if(NOT ${BUILD_SHARED_LIBS})
|
||||
add_definitions(-DSEXP_STATIC_LIBRARY=1)
|
||||
endif()
|
||||
|
||||
|
@ -172,13 +172,7 @@ add_custom_command(OUTPUT ${clibout}
|
|||
# Core library
|
||||
#
|
||||
|
||||
if(CHIBI_SCHEME_SHARED)
|
||||
set(libtype SHARED)
|
||||
else()
|
||||
set(libtype STATIC)
|
||||
endif()
|
||||
|
||||
add_library(lib-chibi-scheme ${libtype}
|
||||
add_library(lib-chibi-scheme
|
||||
${chibi-scheme-srcs}
|
||||
${clibout})
|
||||
|
||||
|
@ -188,14 +182,14 @@ set_target_properties(lib-chibi-scheme
|
|||
|
||||
add_dependencies(lib-chibi-scheme chibi-scheme-stubs)
|
||||
|
||||
if(WIN32 AND CHIBI_SCHEME_SHARED)
|
||||
if(WIN32 AND ${BUILD_SHARED_LIBS})
|
||||
target_link_libraries(lib-chibi-scheme ws2_32)
|
||||
target_compile_definitions(lib-chibi-scheme PUBLIC -DBUILDING_DLL=1)
|
||||
endif()
|
||||
|
||||
function(bless_chibi_scheme_executable tgt)
|
||||
target_link_libraries(${tgt} lib-chibi-scheme)
|
||||
if(WIN32 AND NOT CHIBI_SCHEME_SHARED)
|
||||
if(WIN32 AND NOT ${BUILD_SHARED_LIBS})
|
||||
target_link_libraries(${tgt} ws2_32)
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
Loading…
Add table
Reference in a new issue