mirror of
https://github.com/albertodemichelis/squirrel.git
synced 2026-01-15 16:08:00 +01:00
Checking them for being defined would get the user intention wrong if they are passed as -DDISABLE_STATIC=Off as that would still count as being defined. Just check for the variable, which has the desired effect. An unset variable is always false. Since these flags are options now the variables are always set, so one cannot disable this features anymore otherwise.
36 lines
1.1 KiB
CMake
36 lines
1.1 KiB
CMake
set(SQSTDLIB_SRC sqstdaux.cpp
|
|
sqstdblob.cpp
|
|
sqstdio.cpp
|
|
sqstdmath.cpp
|
|
sqstdrex.cpp
|
|
sqstdstream.cpp
|
|
sqstdstring.cpp
|
|
sqstdsystem.cpp)
|
|
|
|
if(NOT DISABLE_DYNAMIC)
|
|
add_library(sqstdlib SHARED ${SQSTDLIB_SRC})
|
|
target_link_libraries(sqstdlib squirrel)
|
|
if(NOT SQ_DISABLE_INSTALLER)
|
|
install(TARGETS sqstdlib RUNTIME DESTINATION ${INSTALL_BIN_DIR}
|
|
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
|
|
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
|
|
endif()
|
|
endif()
|
|
|
|
if(NOT DISABLE_STATIC)
|
|
add_library(sqstdlib_static STATIC ${SQSTDLIB_SRC})
|
|
if(NOT SQ_DISABLE_INSTALLER)
|
|
install(TARGETS sqstdlib_static ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
|
|
endif()
|
|
endif()
|
|
|
|
if(LONG_OUTPUT_NAMES)
|
|
if(NOT DISABLE_DYNAMIC)
|
|
set_target_properties(sqstdlib PROPERTIES OUTPUT_NAME sqstdlib3)
|
|
endif()
|
|
|
|
if(NOT DISABLE_STATIC)
|
|
set_target_properties(sqstdlib_static PROPERTIES OUTPUT_NAME sqstdlib3_static)
|
|
endif()
|
|
endif()
|