1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Get rid of interface libraries to keep cmake requirements low.

This commit is contained in:
Sandu Liviu Catalin 2020-03-22 18:35:07 +02:00
parent 0b8da79404
commit feb1652c83
2 changed files with 20 additions and 21 deletions

View File

@ -1,30 +1,28 @@
# Create the Sqrat library
add_library(Sqrat INTERFACE)
add_library(Sqrat STATIC sqrat.cpp sqrat.h
sqrat/sqratAllocator.h
sqrat/sqratArray.h
sqrat/sqratClass.h
sqrat/sqratConst.h
sqrat/sqratFunction.h
sqrat/sqratGlobalMethods.h
sqrat/sqratMemberMethods.h
sqrat/sqratObject.h
sqrat/sqratOverloadMethods.h
sqrat/sqratScript.h
sqrat/sqratTable.h
sqrat/sqratTypes.h
sqrat/sqratUtil.h
)
# Set library compiler options
target_compile_definitions(Sqrat INTERFACE SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1)
target_compile_definitions(Sqrat PUBLIC SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1)
# Set specific compiler options
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
#target_compile_options(Sqrat PRIVATE -w
#)
endif()
# Library includes
target_include_directories(Sqrat INTERFACE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(Sqrat INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_include_directories(Sqrat PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(Sqrat PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
# Link to required libraries
target_link_libraries(Sqrat INTERFACE Squirrel)
# Add it's sources
target_sources(Sqrat INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/sqrat.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratAllocator.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratArray.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratClass.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratConst.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratFunction.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratGlobalMethods.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratMemberMethods.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratObject.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratOverloadMethods.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratScript.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratTable.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratTypes.h
${CMAKE_CURRENT_SOURCE_DIR}/sqrat/sqratUtil.h
)
target_link_libraries(Sqrat PUBLIC Squirrel)

1
sqrat/sqrat.cpp Normal file
View File

@ -0,0 +1 @@
#include <sqrat.h>