Skip to content

Commit

Permalink
Conditionally enable CXX in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahajha committed Nov 9, 2024
1 parent 7c1f1cd commit 0adc6b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/mpdecimal/2.5.x/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX C)
project(test_package LANGUAGES C)

enable_testing()

Expand All @@ -11,6 +11,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE mpdecimal::libmpdecimal)
add_test(NAME test_package COMMAND test_package 10 13)

if(TARGET mpdecimal::libmpdecimal++)
enable_language(CXX)
add_executable(${PROJECT_NAME}_cpp test_package.cpp)
set_propertY(TARGET ${PROJECT_NAME}_cpp PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME}_cpp PRIVATE mpdecimal::libmpdecimal++)
Expand Down

0 comments on commit 0adc6b9

Please sign in to comment.