diff --git a/pyodide_build/tools/cmake/Modules/Platform/Emscripten.cmake b/pyodide_build/tools/cmake/Modules/Platform/Emscripten.cmake index 78b4487e..f82c8e02 100644 --- a/pyodide_build/tools/cmake/Modules/Platform/Emscripten.cmake +++ b/pyodide_build/tools/cmake/Modules/Platform/Emscripten.cmake @@ -102,8 +102,8 @@ endif() # Set SIDE_MODULE_CFLAGS and SIDE_MODULE_LDFLAGS automatically # This is automatically set for Python project, but we often omit these in libraries. -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} $ENV{SIDE_MODULE_CFLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{SIDE_MODULE_CXXFLAGS}") +set(CMAKE_C_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} $ENV{SIDE_MODULE_CFLAGS}") +set(CMAKE_CXX_FLAGS_INIT "${CMAKE_CXX_FLAGS_INIT} $ENV{SIDE_MODULE_CXXFLAGS}") set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{SIDE_MODULE_LDFLAGS}") set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{SIDE_MODULE_LDFLAGS}")