File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ if(CCACHE_FOUND)
52
52
endif (CCACHE_FOUND )
53
53
54
54
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
55
- if (RAPIDJSON_ENABLE_INSTRUMENTATION_OPT )
55
+ if (RAPIDJSON_ENABLE_INSTRUMENTATION_OPT AND NOT CMAKE_CROSSCOMPILING )
56
56
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le" )
57
57
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native" )
58
58
else ()
@@ -84,11 +84,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
84
84
endif ()
85
85
endif ()
86
86
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
87
- if (CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le" )
88
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native" )
89
- else ()
90
- #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
91
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native" )
87
+ if (NOT CMAKE_CROSSCOMPILING )
88
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le" )
89
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native" )
90
+ else ()
91
+ #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
92
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native" )
93
+ endif ()
92
94
endif ()
93
95
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers" )
94
96
set (EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough )
You can’t perform that action at this time.
0 commit comments