From d79922d7255211f47b48715c04db75df4e616fdc Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 22 Mar 2020 18:46:38 +0200 Subject: [PATCH] Try another way because that doesn't work everywhere. --- module/Vendor/MaxmindDB/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/Vendor/MaxmindDB/CMakeLists.txt b/module/Vendor/MaxmindDB/CMakeLists.txt index d4ea339b..3a2803f5 100644 --- a/module/Vendor/MaxmindDB/CMakeLists.txt +++ b/module/Vendor/MaxmindDB/CMakeLists.txt @@ -27,8 +27,14 @@ add_library(MaxmindDB STATIC include/maxminddb_config.h.in src/data-pool.h src/data-pool.c src/maxminddb-compat-util.h ) -# Set C standard -set_property(TARGET MaxmindDB PROPERTY C_STANDARD 99) +# Set C99 standard +if (CMAKE_VERSION VERSION_LESS "3.1") + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}") + endif () +else () + set(CMAKE_C_STANDARD 99) +endif () # Configure include folders target_include_directories(MaxmindDB PRIVATE ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(MaxmindDB PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)