Build static libraries

This commit is contained in:
Dane Johnson 2021-03-16 13:33:49 -05:00
parent 1fa59c3fad
commit 27cd78510e
6 changed files with 36 additions and 23 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
build/
build-win/
binaries/
dist/

View File

@ -24,6 +24,8 @@ add_dependencies(couchlib shader_headers)
target_include_directories(couchlib
PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/shaders/")
file(COPY LICENSE CORRESPONDINGSOURCE.txt DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
if(WIN32)
target_link_libraries(couch glfw3dll)
target_link_libraries(couch ssp)

View File

@ -1,6 +1,7 @@
#!/bin/bash
set -e
cd `dirname $0`
mkdir -p build
cd build

View File

@ -16,7 +16,7 @@ if (LUA_ENABLED)
find_package(Lua REQUIRED)
endif ()
add_library(couchlib SHARED)
add_library(couchlib STATIC)
target_sources(couchlib PUBLIC
Camera.h
Camera.cpp
@ -69,11 +69,8 @@ target_sources(couchlib PUBLIC
Shaders/SkyboxShader.cpp)
if (WIN32)
add_library(couchlib_luascripting STATIC)
else ()
add_library(couchlib_luascripting SHARED)
endif ()
add_library(couchlib_luascripting STATIC)
target_sources(couchlib_luascripting PUBLIC
Scripting/Lua.h
Scripting/Lua.cpp)

18
package.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
cd `dirname $0`
mkdir -p dist
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
rm -f couch-linux.tgz
tar cvzf couch-linux.tgz \
couch \
CORRESPONDINGSOURCE.txt \
LICENSE
mv couch-linux.tgz ../dist

View File

@ -4,21 +4,15 @@ set_property(SOURCE couch.i PROPERTY CPLUSPLUS ON)
set_property(SOURCE couch.i PROPERTY USE_TARGET_INCLUDE_DIRECTORIES ON)
if (LUA_ENABLED)
if (NOT WIN32)
swig_add_library(couchlua
TYPE SHARED
LANGUAGE lua
SOURCES couch.i lua/helpers.i)
else()
swig_add_library(couchlua
TYPE STATIC
LANGUAGE lua
SOURCES couch.i lua/helpers.i)
endif()
target_include_directories(couchlua PRIVATE "${PROJECT_SOURCE_DIR}/core")
swig_add_library(couchlua
TYPE STATIC
LANGUAGE lua
SOURCES couch.i lua/helpers.i)
swig_link_libraries(couchlua
PRIVATE
couchlib
${LUA_LIBRARIES})
target_include_directories(couchlua PRIVATE "${PROJECT_SOURCE_DIR}/core")
swig_link_libraries(couchlua
PRIVATE
couchlib
${LUA_LIBRARIES})
endif ()