Testing modules
This commit is contained in:
@@ -129,7 +129,8 @@
|
||||
|
||||
list(APPEND FGL_CONFIG "-ftree-vectorize")
|
||||
list(APPEND FGL_CONFIG "-fmax-errors=6")
|
||||
|
||||
LIST(APPEND FGL_CONFIG "-fmodules-ts")
|
||||
LIST(APPEND FGL_CONFIG "-std=c++23")
|
||||
|
||||
#AppendWarningFlag("-fanalyzer")
|
||||
#AppendWarningFlag("-Wanalyzer-too-complex")
|
||||
@@ -162,7 +163,7 @@
|
||||
|
||||
list(APPEND FGL_FLAGS ${FGL_CONFIG})
|
||||
list(APPEND FGL_FLAGS ${FGL_FINAL_FLAGS_${UPPER_BUILD_TYPE}})
|
||||
list(APPEND FGL_FLAGS ${FGL_WARNINGS})
|
||||
# list(APPEND FGL_FLAGS ${FGL_WARNINGS})
|
||||
|
||||
list(APPEND FGL_CHILD_FLAGS ${FGL_FINAL_FLAGS_${UPPER_BUILD_TYPE}})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
|
||||
function(PreSetup)
|
||||
PlatformPreSetup()
|
||||
@@ -13,16 +13,39 @@ function(PostSetup)
|
||||
endfunction()
|
||||
|
||||
function(AddFGLExecutable NAME SRC_SOURCES_LOCATION)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
file(GLOB_RECURSE M_SOURCES CONFIGURE_DEPENDS
|
||||
${SRC_SOURCES_LOCATION}/**.cppm)
|
||||
|
||||
# add_library(${NAME}_MODULES)
|
||||
# target_sources(${NAME}_MODULES PUBLIC FILE_SET CXX_MODULES FILES ${M_SOURCES})
|
||||
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
|
||||
${SRC_SOURCES_LOCATION}/**.cpp
|
||||
${SRC_SOURCES_LOCATION}/**.hpp
|
||||
)
|
||||
add_executable(${NAME} ${SOURCES})
|
||||
|
||||
message("Compiling ${NAME} WITH ${M_SOURCES} as modules")
|
||||
|
||||
add_executable(${NAME})
|
||||
target_sources(${NAME} PUBLIC ${SOURCES})
|
||||
target_sources(${NAME} PUBLIC FILE_SET modules TYPE CXX_MODULES FILES ${M_SOURCES})
|
||||
|
||||
target_include_directories(${NAME} PRIVATE ${SRC_SOURCES_LOCATION})
|
||||
target_link_libraries(${NAME} PRIVATE ${NAME}_MODULES)
|
||||
set_target_properties(${NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
SetFGLFlags(${NAME})
|
||||
endfunction()
|
||||
|
||||
function(LinkLibs NAME ACCESS LIB)
|
||||
# if (TARGET ${NAME}_MODULES)
|
||||
# target_link_libraries(${NAME}_MODULES ${ACCESS} ${LIB})
|
||||
# endif ()
|
||||
target_link_libraries(${NAME} ${ACCESS} ${LIB})
|
||||
endfunction()
|
||||
|
||||
function(AddFGLLibrary NAME MODE SRC_SOURCES_LOCATION INCLUDE_SOURCES_LOCATION)
|
||||
file(GLOB_RECURSE CPP_SOURCES CONFIGURE_DEPENDS ${SRC_SOURCES_LOCATION}/**.cpp)
|
||||
file(GLOB_RECURSE HPP_SOURCES CONFIGURE_DEPENDS ${SRC_SOURCES_LOCATION}/**.hpp)
|
||||
|
||||
Reference in New Issue
Block a user