Skip to content

Commit

Permalink
Make BUILD_SHARED_LIBS optional
Browse files Browse the repository at this point in the history
PR rafaelsteil#39 changed the behaviour to support building a shared or static
library based on the global CMake variable BUILD_SHARED_LIBS, but the
build system had to set it from outside. Now it's an option and the user
can easily set it in the CMake GUI, while setting from outside is of
course still possible. Additionally this allows us to change the default
from building a static library to building a shared library like it was
before PR rafaelsteil#39.
  • Loading branch information
LeSpocky committed Sep 11, 2017
1 parent 58edd50 commit 030ee36
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2013,2016 Alexander Dahl <post@lespocky.de>
# Copyright 2013,2016,2017 Alexander Dahl <post@lespocky.de>
#
cmake_minimum_required(VERSION 2.8.8)

Expand Down Expand Up @@ -31,6 +31,12 @@ include(GNUInstallDirs) # cmake 2.8.5
# additional compiler flags
add_definitions(-Wall -Wextra -Wcast-align)

# options
option(BUILD_SHARED_LIBS
"Global flag to cause add_library to create shared libraries if on."
ON
)

# subdirectories
add_subdirectory("src")

Expand Down

0 comments on commit 030ee36

Please sign in to comment.