mirror of
https://gitlab.com/manzerbredes/chessarbiter.git
synced 2025-04-05 17:46:26 +02:00
Switch to STATIC library and improve CMake integration
This commit is contained in:
parent
27116f3b15
commit
987bf4b2f2
2 changed files with 8 additions and 8 deletions
|
@ -3,4 +3,4 @@ archlinux:
|
|||
before_script:
|
||||
- pacman -Sy cmake --noconfirm --needed
|
||||
script:
|
||||
- mkdir build && cd build && cmake ../ && make && ctest
|
||||
- mkdir build && cd build && cmake -DCOMPILE_TESTS:BOOL=ON ../ && make && ctest
|
||||
|
|
|
@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.10)
|
|||
project(chessarbiter)
|
||||
|
||||
# Shared library
|
||||
add_library(chessarbiter SHARED src/Piece.cpp src/Board.cpp src/Fen.cpp src/ChessArbiter.cpp)
|
||||
include_directories(src/)
|
||||
|
||||
# Includes
|
||||
set(CHESSARBITER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src PARENT_SCOPE) # To be used by other projects with add_subdirectory()
|
||||
add_library(chessarbiter STATIC src/Piece.cpp src/Board.cpp src/Fen.cpp src/ChessArbiter.cpp)
|
||||
target_include_directories(chessarbiter PUBLIC src/)
|
||||
|
||||
# Unit tests
|
||||
enable_testing()
|
||||
add_subdirectory(./tests)
|
||||
set(COMPILE_TESTS OFF CACHE BOOL "Should unit tests be compiled")
|
||||
if(COMPILE_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(./tests)
|
||||
endif()
|
Loading…
Add table
Reference in a new issue