Selaa lähdekoodia

fix(cmake): Correctly remove architecture flags from CMAKE_C_FLAGS

Stefan Profanter 5 vuotta sitten
vanhempi
commit
fd8d593abd
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      CMakeLists.txt

+ 3 - 0
CMakeLists.txt

@@ -1132,6 +1132,9 @@ GET_PROPERTY(ua_architecture_remove_definitions GLOBAL PROPERTY UA_ARCHITECTURE_
 if (NOT "${ua_architecture_remove_definitions}" STREQUAL "")
   string(REPLACE " " ";" ua_architecture_remove_definitions_list ${ua_architecture_remove_definitions})
   remove_definitions(${ua_architecture_remove_definitions_list})
+  foreach ( flag ${ua_architecture_remove_definitions} )
+      string(REPLACE "${flag}" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+  endforeach()
 endif(NOT "${ua_architecture_remove_definitions}" STREQUAL "")
 
 GET_PROPERTY(ua_architecture_append_to_library GLOBAL PROPERTY UA_ARCHITECTURE_APPEND_TO_LIBRARY)