Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options instead of forcing them #32

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ if(NOT foonathan_memory_FOUND)
# unless the library was explicitly added as a static library.
option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)

# Option to build memory examples
option(BUILD_MEMORY_EXAMPLES "Build memory examples" OFF)
# Option to build memory tests
option(BUILD_MEMORY_TESTS "Build memory tests" OFF)
# Option to build memory tools
option(BUILD_MEMORY_TOOLS "Build memory tools" ON)
MiguelCompany marked this conversation as resolved.
Show resolved Hide resolved

if(BUILD_SHARED_LIBS)
# Library will be statically created with PIC code
list(APPEND extra_cmake_args -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
Expand Down Expand Up @@ -61,9 +68,9 @@ if(NOT foonathan_memory_FOUND)
# Avoid the update (git pull) and so the recompilation of foonathan_memory library each time.
UPDATE_COMMAND ""
CMAKE_ARGS
-DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF
-DFOONATHAN_MEMORY_BUILD_TESTS=OFF
-DFOONATHAN_MEMORY_BUILD_TOOLS=ON
-DFOONATHAN_MEMORY_BUILD_EXAMPLES=${BUILD_MEMORY_EXAMPLES}
-DFOONATHAN_MEMORY_BUILD_TESTS=${BUILD_MEMORY_TESTS}
-DFOONATHAN_MEMORY_BUILD_TOOLS=${BUILD_MEMORY_TOOLS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/foo_mem_ext_prj_install
${extra_cmake_args}
-Wno-dev
Expand Down