Skip to content

Commit

Permalink
Merge pull request #2266 from Smit-create/i-2264
Browse files Browse the repository at this point in the history
CMAKE: Set linker language
  • Loading branch information
certik committed Aug 13, 2023
2 parents c996185 + d61f30a commit ddd49cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,15 @@ macro(COMPILE)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
add_library(${name} OBJECT ${name}.o)
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
elseif(KIND STREQUAL "c")
add_custom_command(
OUTPUT ${name}.c
COMMAND ${LPYTHON} ${extra_args} --disable-main --show-c ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py > ${name}.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.py
VERBATIM)
add_library(${name} OBJECT ${name}.c)
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(${name} lpython_rtlib)
elseif(KIND STREQUAL "cpython")
# CPython test
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run_test(backend):
run_cmd(f"mkdir {BASE_DIR}/_lpython-tmp-test-{backend}", cwd=BASE_DIR)
cwd = f"{BASE_DIR}/_lpython-tmp-test-{backend}"
run_cmd(f"cmake -DKIND={backend} -DFAST={fast_tests} -DPYTHON_LIBS_REQ={python_libs_req} ..", cwd=cwd)
run_cmd(f"make -j{DEFAULT_THREADS_TO_USE}", cwd=cwd)
run_cmd(f"cmake --build . --parallel {DEFAULT_THREADS_TO_USE}", cwd=cwd)
run_cmd(f"ctest -j{DEFAULT_THREADS_TO_USE} --output-on-failure",
cwd=cwd)

Expand Down

0 comments on commit ddd49cc

Please sign in to comment.