File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change
1
+ include (CheckSourceCompiles )
2
+ # Compiler capability test
3
+ check_source_compiles (Fortran
4
+ "program test
5
+ character(kind=selected_char_kind('ISO_10646')) :: c
6
+ end program"
7
+ HAS_Fortran_UTF8
8
+ )
9
+
1
10
# compiler flags for gfortran
2
11
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
3
12
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ ${_src}/json_module.F90
23
23
)
24
24
25
25
add_library (jsonfortran ${JF_LIB_SRCS} )
26
- target_compile_definitions (jsonfortran PRIVATE ${JSON_REAL_KIND} ${JSON_INT_KIND} )
26
+ target_compile_definitions (jsonfortran PRIVATE
27
+ ${JSON_REAL_KIND} ${JSON_INT_KIND}
28
+ $< $< BOOL:${HAS_Fortran_UTF8} > :USE_UCS4>
29
+ )
27
30
target_include_directories (jsonfortran PUBLIC
28
31
$< BUILD_INTERFACE:${CMAKE_BINARY_DIR} /include>
29
32
$< INSTALL_INTERFACE:include>
You can’t perform that action at this time.
0 commit comments