mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-04 07:01:46 +02:00
Move Squirrel and Sqrat into the root level directory.
Create the initial CMake build scripts.
This commit is contained in:
41
CMakeLists.txt
Normal file
41
CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
cmake_minimum_required(VERSION 3.0.2)
|
||||
project(SqMod)
|
||||
|
||||
# Several plugin options
|
||||
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)
|
||||
|
||||
# Default to c++14 standard
|
||||
if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
endif()
|
||||
else()
|
||||
# Apparently the above does not work with cmake from on debian 8
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
# Try the standard method as well
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
# Default to release mode
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
|
||||
# Include mingw runntime into the binary
|
||||
if (GCC OR MINGW)
|
||||
if(BUILTIN_RUNTIMES)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable position independent code
|
||||
if (UNIX)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
# Include Squirrel library
|
||||
add_subdirectory(squirrel)
|
||||
# Include Squat library
|
||||
add_subdirectory(sqrat)
|
||||
# Global include directories
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
Reference in New Issue
Block a user