Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
# Generic warnings.
|
||||
#set(FGL_WARNINGS "-Wall;-Wundef;-Wextra;-Wpedantic")
|
||||
|
||||
|
||||
AppendWarningFlag("-Wall")
|
||||
AppendWarningFlag("-Wundef")
|
||||
AppendWarningFlag("-Wextra")
|
||||
@@ -107,12 +109,32 @@
|
||||
AppendWarningFlag("-fdiagnostics-path-format=inline-events")
|
||||
|
||||
list(APPEND FGL_CONFIG "-fconcepts-diagnostics-depth=8")
|
||||
list(APPEND FGL_CONFIG "-flto=auto")
|
||||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
|
||||
|
||||
if (NOT DEFINED STATIC_ANAYLSIS)
|
||||
set(STATIC_ANYLSIS 1)
|
||||
endif ()
|
||||
|
||||
|
||||
# if (STATIC_ANALYSIS EQUAL 1 AND UPPER_BUILD_TYPE STREQUAL "DEBUG")
|
||||
# list(APPEND FGL_CONFIG "-fanalyzer")
|
||||
# if (NOT DEFINED USE_WERROR OR NOT USE_WERROR)
|
||||
# list(APPEND FGL_CONFIG "-Wanalyzer-too-complex")
|
||||
# endif ()
|
||||
# elseif (NOT UPPER_BUILD_TYPE STREQUAL "DEBUG")
|
||||
if (NOT UPPER_BUILD_TYPE STREQUAL "DEBUG")
|
||||
list(APPEND FGL_CONFIG "-flto=auto")
|
||||
endif ()
|
||||
|
||||
list(APPEND FGL_CONFIG "-ftree-vectorize")
|
||||
list(APPEND FGL_CONFIG "-fmax-errors=6")
|
||||
|
||||
|
||||
if (DEFINED USE_WERROR)
|
||||
#AppendWarningFlag("-fanalyzer")
|
||||
#AppendWarningFlag("-Wanalyzer-too-complex")
|
||||
|
||||
if (DEFINED USE_WERROR AND USE_WERROR)
|
||||
list(APPEND FGL_CONFIG "-Werror")
|
||||
endif ()
|
||||
|
||||
@@ -131,7 +153,6 @@
|
||||
list(APPEND FGL_SHARED_DEBUG "-gdwarf-4")
|
||||
list(APPEND FGL_SHARED_DEBUG "-fvar-tracking-assignments")
|
||||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
|
||||
|
||||
# Optimization flags
|
||||
set(FGL_FINAL_FLAGS_RELEASE "-O2;-s;${FGL_GENERAL_OPTIMIZATION_FLAGS};${FGL_SHARED_OPTIMIZATION_FLAGS}") # System agonistc flags
|
||||
@@ -145,9 +166,6 @@
|
||||
|
||||
list(APPEND FGL_CHILD_FLAGS ${FGL_FINAL_FLAGS_${UPPER_BUILD_TYPE}})
|
||||
|
||||
message(" -- FGL_FLAGS: ${FGL_FLAGS}")
|
||||
message("-- FGL_CHILD_FLAGS: ${FGL_CHILD_FLAGS}")
|
||||
|
||||
# Final sets
|
||||
#set(FGL_FLAGS "${FGL_CONFIG};${FGL_FINAL_FLAGS_${UPPER_BUILD_TYPE}};${FGL_WARNINGS}") # Flags for our shit
|
||||
#set(FGL_FLAGS "${FGL_OPTIMIZATION_FLAGS_${UPPER_BUILD_TYPE}}" PARENT_SCOPE)
|
||||
|
||||
@@ -31,4 +31,14 @@ function(AddFGLLibrary NAME MODE SRC_SOURCES_LOCATION INCLUDE_SOURCES_LOCATION)
|
||||
target_include_directories(${NAME} PUBLIC ${INCLUDE_SOURCES_LOCATION})
|
||||
target_include_directories(${NAME} PRIVATE ${SRC_SOURCES_LOCATION})
|
||||
SetFGLFlags(${NAME})
|
||||
endfunction()
|
||||
endfunction()
|
||||
|
||||
function(AddFGLChildLibrary NAME MODE SRC_SOURCES_LOCATION INCLUDE_SOURCES_LOCATION)
|
||||
file(GLOB_RECURSE CPP_SOURCES ${SRC_SOURCES_LOCATION}/**.cpp)
|
||||
file(GLOB_RECURSE HPP_SOURCES ${SRC_SOURCES_LOCATION}/**.hpp)
|
||||
file(GLOB_RECURSE INCLUDE_HPP_SOURCES ${INCLUDE_SOURCES_LOCATION}/**.hpp)
|
||||
add_library(${NAME} ${MODE} ${CPP_SOURCES} ${HPP_SOURCES} ${INCLUDE_SOURCES_LOCATION})
|
||||
target_include_directories(${NAME} PUBLIC ${INCLUDE_SOURCES_LOCATION})
|
||||
target_include_directories(${NAME} PRIVATE ${SRC_SOURCES_LOCATION})
|
||||
# SetFGLFlags(${NAME})
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user