Skip to content

Commit

Permalink
Make linking to stdc++fs common
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 20, 2024
1 parent 340cce1 commit d5bf1cc
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 62 deletions.
6 changes: 6 additions & 0 deletions src/tests/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ function(add_boost_test)

# Give the IDE some directions to display tests in a "Unit-tests" folder
set_target_properties(${TEST_NAME} PROPERTIES FOLDER Unit-tests)

# Linux only. TODO remove ?
if(UNIX AND NOT APPLE)
target_link_libraries(${TEST_NAME} PRIVATE stdc++fs)
endif()

endfunction()
11 changes: 0 additions & 11 deletions src/tests/src/libs/antares/study/area/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ add_boost_test(test-save-link-properties
INCLUDE "${src_libs_antares_study}/include"
LIBS model_antares)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-save-link-properties PRIVATE stdc++fs)
endif()

# ===================================
# Tests on area's optimization.ini
# ===================================
Expand All @@ -33,9 +28,3 @@ add_boost_test(test-save-area-optimization-ini
SRC ${SRC_AREA_OPTIMIZATION}
INCLUDE "${src_libs_antares_study}/include"
LIBS model_antares)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-save-area-optimization-ini PRIVATE stdc++fs)
endif()

8 changes: 0 additions & 8 deletions src/tests/src/libs/antares/study/constraint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ add_boost_test(test_constraint
test_utils_unit
Antares::study)

if(UNIX AND NOT APPLE)
target_link_libraries(test_constraint PRIVATE stdc++fs)
endif()

add_boost_test(test_groups
SRC test_group.cpp
LIBS
test_utils_unit
Antares::study)

if(UNIX AND NOT APPLE)
target_link_libraries(test_groups PRIVATE stdc++fs)
endif()
5 changes: 0 additions & 5 deletions src/tests/src/libs/antares/study/output-folder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,3 @@ add_boost_test(test-folder-output
SRC study.cpp
INCLUDE "${src_libs_antares_study}"
LIBS Antares::study)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-folder-output PRIVATE stdc++fs)
endif()
9 changes: 0 additions & 9 deletions src/tests/src/libs/antares/study/parts/hydro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@ add_boost_test(test-hydro-reader
Antares::study
test_utils_unit)

if(UNIX AND NOT APPLE)
target_link_libraries(test-hydro-reader PRIVATE stdc++fs)
endif()

# Hydro series
add_boost_test(test-hydro-series
SRC test-hydro-series.cpp
LIBS
Antares::study
test_utils_unit)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-hydro-series PRIVATE stdc++fs)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ add_boost_test(test-sc-builder-file-read-line
INCLUDE "${src_libs_antares_study}/include"
LIBS model_antares)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-sc-builder-file-read-line PRIVATE stdc++fs)
endif()

# ====================================
# Tests on saving scenario-builder
# ====================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ add_boost_test(short-term-storage-input
SRC short-term-storage-input-output.cpp
LIBS model_antares
INCLUDE "${src_libs_antares_study}/parts/short-term-storage")

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(short-term-storage-input PRIVATE stdc++fs)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,3 @@ add_boost_test(thermal-price-definition
"${src_libs_antares_study}/area"
"${src_libs_antares_study}"
"${src_libs_antares_checks}")

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(thermal-price-definition PRIVATE stdc++fs)
endif()
14 changes: 0 additions & 14 deletions src/tests/src/solver/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ add_boost_test(test-store-timeseries-number
antares-solver-simulation
Antares::study
Antares::result_writer)
# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-store-timeseries-number PRIVATE stdc++fs)
endif()

# ===================================
# Tests on time series
Expand All @@ -50,11 +46,6 @@ add_boost_test(test-time_series
antares-solver-simulation
Antares::study)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-time_series PRIVATE stdc++fs)
endif()

# ===================================
# Tests on hydro final reservoir level functions
# ===================================
Expand All @@ -69,8 +60,3 @@ add_boost_test(test-hydro_final
Antares::study
antares-solver-simulation
Antares::array)

# Linux
if(UNIX AND NOT APPLE)
target_link_libraries(test-hydro_final PRIVATE stdc++fs)
endif()

0 comments on commit d5bf1cc

Please sign in to comment.