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

Plugin development mode.

Temporary workaround untill a better approach is implemented.
This commit is contained in:
Sandu Liviu Catalin 2020-05-10 12:19:46 +03:00
parent ca1f6cda50
commit 22c882639b
4 changed files with 24 additions and 10 deletions

View File

@ -7,12 +7,13 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Several plugin options # Several plugin options
option(BUILTIN_RUNTIMES "Include the MinGW runtime into the binary itself." ON) option(BUILTIN_RUNTIMES "Include the MinGW runtime into the binary itself." ON)
option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF) option(FORCE_32BIT_BIN "Create a 32-bit executable binary if the compiler defaults to 64-bit." OFF)
option(PLUGIN_DEVEL "Switch to plugin development." OFF)
option(ENABLE_MYSQL "Enable the MySQL library." OFF) option(ENABLE_MYSQL "Enable the MySQL library." OFF)
option(ENABLE_API21 "Build for 2.1 API." OFF) option(ENABLE_API21 "Build for 2.1 API." OFF)
# Default to c++14 standard # Default to c++14 standard
if(CMAKE_VERSION VERSION_LESS "3.1") if(CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif() endif()
else() else()
@ -29,14 +30,14 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
endif() endif()
# Include mingw runntime into the binary # Include mingw runntime into the binary
if (GCC OR MINGW) if(GCC OR MINGW)
if(BUILTIN_RUNTIMES) if(BUILTIN_RUNTIMES)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static") set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
endif() endif()
endif() endif()
# Enable position independent code # Enable position independent code
if (UNIX) if(UNIX)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif() endif()
# Include VCMP library # Include VCMP library
@ -47,7 +48,10 @@ add_subdirectory(squirrel)
add_subdirectory(sqrat) add_subdirectory(sqrat)
# Include SDK library # Include SDK library
add_subdirectory(sdk) add_subdirectory(sdk)
# Include Module library if(PLUGIN_DEVEL)
add_subdirectory(module) # Include Sample module
# Include Sample module add_subdirectory(hello)
#add_subdirectory(hello) else()
# Include Module library
add_subdirectory(module)
end()

View File

@ -16,5 +16,7 @@ target_include_directories(SqSDK PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(SqSDK PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) target_include_directories(SqSDK PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
# Link to required libraries # Link to required libraries
target_link_libraries(SqSDK PRIVATE VCMP SquirrelAPI) target_link_libraries(SqSDK PRIVATE VCMP SquirrelAPI)
# Compile definitions # Switch to plugin-development mode
target_compile_definitions(SqSDK PUBLIC SQMOD_PLUGIN_API=1) if(PLUGIN_DEVEL)
target_compile_definitions(SqSDK PUBLIC SQMOD_PLUGIN_API=1)
end()

View File

@ -22,6 +22,10 @@ else()
endif() endif()
# Set library compiler options # Set library compiler options
target_compile_definitions(Sqrat PUBLIC SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1) target_compile_definitions(Sqrat PUBLIC SCRAT_USE_EXCEPTIONS=1 SCRAT_USE_CXX11_OPTIMIZATIONS=1)
# Switch to plugin-development mode
if(PLUGIN_DEVEL)
target_compile_definitions(Sqrat PUBLIC SQMOD_PLUGIN_API=1)
end()
# Set specific compiler options # Set specific compiler options
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
#target_compile_options(Sqrat PRIVATE -w #target_compile_options(Sqrat PRIVATE -w

View File

@ -71,3 +71,7 @@ target_include_directories(Squirrel PRIVATE ${CMAKE_CURRENT_LIST_DIR}/stdlib)
add_library(SquirrelAPI INTERFACE) add_library(SquirrelAPI INTERFACE)
# Library includes # Library includes
target_include_directories(SquirrelAPI INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) target_include_directories(SquirrelAPI INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
# Switch to plugin-development mode
if(PLUGIN_DEVEL)
target_compile_definitions(SquirrelAPI PUBLIC SQMOD_PLUGIN_API=1)
end()