From dfb5d59119989def70472b99b643f6371c3e0b88 Mon Sep 17 00:00:00 2001 From: Austin Schneider Date: Sun, 20 Oct 2024 20:54:26 -0600 Subject: [PATCH] Link photospline with CFITSIO. Use generator expressions for -s and -stdlib=libc++ --- CMakeLists.txt | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c27368768..7b1b81d7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,12 +50,9 @@ function(apply_siren_compile_options target) $<$:-g> $<$:-O0> $<$:-O2> - $<$:-s> + $<$,$>:-s> + $<$:-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 @@ -65,12 +62,9 @@ function(apply_siren_compile_options target) $<$:-g> $<$:-O0> $<$:-O2> - $<$:-s> + $<$,$>:-s> + $<$:-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 @@ -80,12 +74,9 @@ function(apply_siren_compile_options target) $<$:-g> $<$:-O0> $<$:-O2> - $<$:-s> + $<$,$>:-s> + $<$:-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() @@ -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)