Skip to content

Commit

Permalink
Link photospline with CFITSIO. Use generator expressions for -s and -…
Browse files Browse the repository at this point in the history
…stdlib=libc++
  • Loading branch information
austinschneider committed Oct 21, 2024
1 parent eb9d2c4 commit dfb5d59
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ function(apply_siren_compile_options target)
$<$<CONFIG:Debug>:-g>
$<$<CONFIG:Debug>:-O0>
$<$<CONFIG:Release>:-O2>
$<$<CONFIG:Release>:-s>
$<$<AND:$<COMPILE_LANG_AND_ID:CXX,GNU>,$<CONFIG:Release>>:-s>
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-stdlib=libc++>
)
# Conditionally add -stdlib=libc++ for Clang
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${target} INTERFACE -stdlib=libc++)
endif()
elseif(target_imported)
# Apply compile options to non-INTERFACE target (PRIVATE or PUBLIC)
target_compile_options(${target} INTERFACE
Expand All @@ -65,12 +62,9 @@ function(apply_siren_compile_options target)
$<$<CONFIG:Debug>:-g>
$<$<CONFIG:Debug>:-O0>
$<$<CONFIG:Release>:-O2>
$<$<CONFIG:Release>:-s>
$<$<AND:$<COMPILE_LANG_AND_ID:CXX,GNU>,$<CONFIG:Release>>:-s>
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-stdlib=libc++>
)
# Conditionally add -stdlib=libc++ for Clang
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${target} INTERFACE -stdlib=libc++)
endif()
else()
# Apply compile options to non-INTERFACE target (PRIVATE or PUBLIC)
target_compile_options(${target} PRIVATE
Expand All @@ -80,12 +74,9 @@ function(apply_siren_compile_options target)
$<$<CONFIG:Debug>:-g>
$<$<CONFIG:Debug>:-O0>
$<$<CONFIG:Release>:-O2>
$<$<CONFIG:Release>:-s>
$<$<AND:$<COMPILE_LANG_AND_ID:CXX,GNU>,$<CONFIG:Release>>:-s>
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-stdlib=libc++>
)
# Conditionally add -stdlib=libc++ for Clang
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${target} PRIVATE -stdlib=libc++)
endif()
endif()
endfunction()

Expand Down Expand Up @@ -133,6 +124,7 @@ endif()
include(photospline)
if(TARGET photospline)
apply_siren_compile_options(photospline)
target_link_libraries(photospline PUBLIC CFITSIO)
endif()
include(googletest)
if(TARGET gtest)
Expand Down

0 comments on commit dfb5d59

Please sign in to comment.