add_library(gopt STATIC gopt.c)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${core_cflags}")

add_library(gopt STATIC gopt.c)
set_target_properties(gopt PROPERTIES COMPILE_FLAGS "${core_cflags}")

Use set_target_properties instead of direct append to CMAKE_C_FLAGS variable.
Use set_target_properties instead of direct append to
CMAKE_C_FLAGS variable.
