File tree 2 files changed +20
-8
lines changed
2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
8
8
find_package (Bash REQUIRED)
9
9
10
10
include (cmake/version .cmake)
11
- include (cmake/cputypetest.cmake)
12
11
13
12
project (KTX-Software
14
13
VERSION ${KTX_VERSION}
@@ -23,6 +22,8 @@ include(CMakeDependentOption)
23
22
include (cmake/mkvk.cmake)
24
23
include (cmake/xcode.cmake)
25
24
25
+ include (cmake/cputypetest.cmake)
26
+
26
27
# OPTIONS
27
28
28
29
if ( IOS OR EMSCRIPTEN )
Original file line number Diff line number Diff line change 34
34
x86
35
35
36
36
#elif TARGET_CPU_X86_64
37
-
38
37
#undef x86_64
39
38
x86_64
40
39
@@ -124,12 +123,24 @@ function(set_target_processor_type out)
124
123
ERROR_QUIET
125
124
)
126
125
else ()
127
- set (C_PREPROCESS ${CMAKE_C_COMPILER} -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -E -P)
128
- execute_process (
129
- COMMAND ${C_PREPROCESS} "${CMAKE_BINARY_DIR} /cputypetest.c"
130
- OUTPUT_VARIABLE processor
131
- OUTPUT_STRIP_TRAILING_WHITESPACE
132
- )
126
+ if (APPLE AND NOT "${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
127
+ # No other Apple systems are x64_64. When configuring for iOS, etc.
128
+ # CMAKE_C_COMPILER points at the HOST compiler - I can't find
129
+ # definitive documentation of what is supposed to happen - the
130
+ # test program above returns x86_64. Since we don't care what
131
+ # type of ARM processor arbitrarily set armv8 for these systems.
132
+ set (processor armv8)
133
+ else ()
134
+ if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
135
+ set (TC_INCLUDE_DIR -I ${CMAKE_OSX_SYSROOT} /usr/include )
136
+ endif ()
137
+ set (C_PREPROCESS ${CMAKE_C_COMPILER} ${TC_INCLUDE_DIR} -E -P)
138
+ execute_process (
139
+ COMMAND ${C_PREPROCESS} "${CMAKE_BINARY_DIR} /cputypetest.c"
140
+ OUTPUT_VARIABLE processor
141
+ OUTPUT_STRIP_TRAILING_WHITESPACE
142
+ )
143
+ endif ()
133
144
endif ()
134
145
135
146
string (STRIP "${processor} " processor)
You can’t perform that action at this time.
0 commit comments