Skip to content

Commit

Permalink
Remove superfluous test that only passes with CMake >= 3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
jcar87 committed Nov 1, 2022
1 parent 65874d3 commit 8f6e9ef
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,8 @@ def test_cmake_tooclahin_vars_when_option_declared():
cmake_minimum_required(VERSION 2.8) # <---- set this to an old version for old policies
project(mylib CXX)
message("CMake version: ${CMAKE_VERSION}")
# Set the options AFTER the call to project, that is, after toolchain is loaded
option(BUILD_SHARED_LIBS "" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "" OFF)
Expand Down Expand Up @@ -1102,12 +1104,6 @@ def test_cmake_tooclahin_vars_when_option_declared():
assert "mylib target type: STATIC_LIBRARY" in t.out
assert "mylib position independent code: ON" in t.out

t.run("create . -o mylib:shared=True -o mylib:fPIC=False --test-folder=None")
assert "mylib target type: SHARED_LIBRARY" in t.out
# Note: cmake will set the target property as to `ON` because being a shared library
# takes precedence (won't produce a shared library with fPIC=false)
assert "mylib position independent code: ON" in t.out

# When building manually, ensure the value passed by the toolchain overrides the ones in
# the CMakeLists
t.run("install . -o mylib:shared=False -o mylib:fPIC=False")
Expand Down

0 comments on commit 8f6e9ef

Please sign in to comment.