Commit 7ed4124
committed
[cmake] Fix handling of BUILD_SHARED_LIBS option
BUILD_SHARED_LIBS option is declared conditionally on whether
BUILD_SHARED_LIBS is defined itself. This is problematic as multiple
invocations of a build runner such as ninja will cause builds to use
different options. The first build will run as if BUILD_SHARED_LIBS is
not defined (i.e. OFF option), the second time cmake will notice that
BUILD_SHARED_LIBS was defined after all and now run build with
BUILD_SHARED_LIBS set to ON. This is confusing and error prone.
To fix the problem, a top-level BUILD_SHARED_LIBS option has been added
and BUILD_SHARED_LIBS option in applications subdirectory was changed to
become active only if the project is standalone.1 parent 5e5cc5b commit 7ed4124
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | | - | |
14 | | - | |
| 12 | + | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
0 commit comments