@@ -28,38 +28,42 @@ find_program(CMAKE_RANLIB llvm-ranlib ${find_program_clang_args})
28
28
find_program (CMAKE_OBJCOPY objcopy ${find_program_binutils_args} )
29
29
find_program (CMAKE_READELF readelf ${find_program_binutils_args} )
30
30
31
- foreach (file_name include include -fixed)
32
- execute_process (
33
- COMMAND ${CMAKE_C_COMPILER} --print-file-name =${file_name}
34
- OUTPUT_VARIABLE _OUTPUT
35
- )
36
- string (REGEX REPLACE "\n " "" _OUTPUT ${_OUTPUT} )
31
+ if (NOT "${ARCH} " STREQUAL "posix" )
37
32
38
- list (APPEND NOSTDINC ${_OUTPUT} )
39
- endforeach ()
33
+ foreach (file_name include include -fixed)
34
+ execute_process (
35
+ COMMAND ${CMAKE_C_COMPILER} --print-file-name =${file_name}
36
+ OUTPUT_VARIABLE _OUTPUT
37
+ )
38
+ string (REGEX REPLACE "\n " "" _OUTPUT ${_OUTPUT} )
40
39
41
- foreach (isystem_include_dir ${NOSTDINC} )
42
- list (APPEND isystem_include_flags -isystem ${isystem_include_dir} )
43
- endforeach ()
40
+ list (APPEND NOSTDINC ${_OUTPUT} )
41
+ endforeach ()
44
42
45
- # This libgcc code is partially duplicated in compiler/*/target.cmake
46
- execute_process (
47
- COMMAND ${CMAKE_C_COMPILER} ${TOOLCHAIN_C_FLAGS} --print-libgcc-file-name
48
- OUTPUT_VARIABLE LIBGCC_FILE_NAME
49
- OUTPUT_STRIP_TRAILING_WHITESPACE
50
- )
43
+ foreach (isystem_include_dir ${NOSTDINC} )
44
+ list (APPEND isystem_include_flags -isystem ${isystem_include_dir} )
45
+ endforeach ()
51
46
52
- assert_exists(LIBGCC_FILE_NAME)
47
+ # This libgcc code is partially duplicated in compiler/*/target.cmake
48
+ execute_process (
49
+ COMMAND ${CMAKE_C_COMPILER} ${TOOLCHAIN_C_FLAGS} --print-libgcc-file-name
50
+ OUTPUT_VARIABLE LIBGCC_FILE_NAME
51
+ OUTPUT_STRIP_TRAILING_WHITESPACE
52
+ )
53
53
54
- get_filename_component (LIBGCC_DIR ${LIBGCC_FILE_NAME} DIRECTORY )
54
+ assert_exists(LIBGCC_FILE_NAME )
55
55
56
- assert_exists (LIBGCC_DIR)
56
+ get_filename_component (LIBGCC_DIR ${LIBGCC_FILE_NAME} DIRECTORY )
57
57
58
- list (APPEND LIB_INCLUDE_DIR "-L\" ${LIBGCC_DIR} \" " )
59
- list (APPEND TOOLCHAIN_LIBS gcc)
58
+ assert_exists(LIBGCC_DIR)
60
59
61
- set (CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,--unresolved-symbols=ignore -in-object-files )
62
- string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} " )
60
+ list (APPEND LIB_INCLUDE_DIR "-L\" ${LIBGCC_DIR} \" " )
61
+ list (APPEND TOOLCHAIN_LIBS gcc)
62
+
63
+ set (CMAKE_REQUIRED_FLAGS -nostartfiles -nostdlib ${isystem_include_flags} -Wl,--unresolved-symbols=ignore -in-object-files )
64
+ string (REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} " )
65
+
66
+ endif ()
63
67
64
68
# Load toolchain_cc-family macros
65
69
0 commit comments