Skip to content

Commit 291a973

Browse files
authored
Update C compile flags to C99 with a workaround for bool enum
Removed C89 compile flag for C sources and updated to C99.
1 parent 285ed52 commit 291a973

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ set(camp_C_SOURCES
9999
sub_models/sub_model_ZSR_aerosol_water.c
100100
)
101101
add_prefix(gitmodules/camp/src/ camp_C_SOURCES)
102-
set_source_files_properties(
103-
${camp_C_SOURCES}
104-
PROPERTIES COMPILE_FLAGS -std=c89
105-
)
106102

107103
set(camp_F_SOURCES
108104
aero_phase_data.F90
@@ -336,6 +332,8 @@ add_prefix(sundials_ SUNDIALS_items)
336332
### CAMP ###########################################################################################
337333

338334
add_library(camplib STATIC ${camp_C_SOURCES} ${camp_F_SOURCES} ${json_fortran_SOURCES})
335+
target_compile_options(camplib PRIVATE $<$<COMPILE_LANGUAGE:C>:-std=c99>)
336+
target_compile_definitions(camplib PRIVATE $<$<COMPILE_LANGUAGE:C>:__bool_true_false_are_defined>)
339337
target_compile_definitions(camplib PRIVATE CAMP_USE_JSON="1")
340338
target_compile_definitions(camplib PRIVATE CAMP_USE_SUNDIALS="1")
341339
target_include_directories(camplib PRIVATE

0 commit comments

Comments
 (0)