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

chapter-01/recipe-05/cxx-example/CMakeLists.txt - wrong logic #513

Open
hanxiatu-fc opened this issue Aug 6, 2019 · 1 comment
Open
Labels

Comments

@hanxiatu-fc
Copy link

hanxiatu-fc commented Aug 6, 2019

Expected Behavior

when USE_LIBRARY is true, we can change some varible to make shared or static lib

Current Behavior

when USE_LIBRARY is true, we can only make shared lib

Possible Solution

  1. add option

option(SHARED_LIB "Compile shared lib" ON)

  1. use USE_LIBRARY and SHARED_LIB togather to decide make shared or staic lib

cmake_dependent_option(
MAKE_STATIC_LIBRARY "Compile sources into a static library"
ON "USE_LIBRARY;NOT SHARED_LIB" OFF
)

cmake_dependent_option(
MAKE_SHARED_LIBRARY "Compile sources into a shared library"
ON "USE_LIBRARY;SHARED_LIB" OFF
)

Steps to Reproduce (for bugs)

any

Context

any

Your Environment

any

@robertodr
Copy link
Collaborator

Hi and thanks for your interest in this project. This bug slipped though! Thanks for reporting it and proposing a solution.

@robertodr robertodr added the bug label Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants