Skip to content

Commit d9de80f

Browse files
committed
cmake: bump minimum required version to 3.3
Adapt our `target_link_libraries` call based on the version of LLVM to account for policy `CMP0023` NEW behavior.
1 parent bf2d7ea commit d9de80f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#=============================================================================
16-
cmake_minimum_required(VERSION 2.8.5)
16+
cmake_minimum_required(VERSION 3.3)
1717
project(CastXML)
1818

1919
include(src/Version.cmake)

src/CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ if(LLVM_LINK_LLVM_DYLIB)
6666
set(USE_SHARED USE_SHARED)
6767
endif()
6868
llvm_config(castxml ${USE_SHARED} ${llvm_libs})
69-
target_link_libraries(castxml PRIVATE ${clang_libs})
69+
if(LLVM_VERSION_MAJOR GREATER 5)
70+
set(maybe_PRIVATE "PRIVATE")
71+
else()
72+
set(maybe_PRIVATE "")
73+
endif()
74+
target_link_libraries(castxml ${maybe_PRIVATE} ${clang_libs})
7075

7176
set_property(SOURCE Utils.cxx APPEND PROPERTY COMPILE_DEFINITIONS
7277
"CASTXML_INSTALL_DATA_DIR=\"${CastXML_INSTALL_DATA_DIR}\"")

test/run.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#=============================================================================
16-
cmake_minimum_required(VERSION 2.8.5)
16+
cmake_minimum_required(VERSION 3.3)
1717

1818
if(xml)
1919
file(REMOVE "${xml}")

0 commit comments

Comments
 (0)