Changes sources for libraries to be private

This commit is contained in:
2025-07-13 21:37:36 -04:00
parent 3fbb7690e8
commit 54beba2a0d

View File

@@ -27,9 +27,6 @@ function(ConfigureFGLTarget NAME SRC_DIR INCLUDE_DIR)
endfunction()
function(AddFGLExecutable NAME SRC_SOURCES_LOCATION)
file(GLOB_RECURSE M_SOURCES CONFIGURE_DEPENDS
${SRC_SOURCES_LOCATION}/**.cppm)
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
${SRC_SOURCES_LOCATION}/**.cpp
${SRC_SOURCES_LOCATION}/**.hpp
@@ -38,8 +35,6 @@ function(AddFGLExecutable NAME SRC_SOURCES_LOCATION)
file(GLOB_RECURSE UI_SOURCES CONFIGURE_DEPENDS
${SRC_SOURCES_LOCATION}/**.ui)
message("Compiling ${NAME} WITH ${M_SOURCES} as modules")
add_executable(${NAME} ${SOURCES})
target_sources(${NAME} PUBLIC ${SOURCES})
target_sources(${NAME} PUBLIC FILE_SET modules TYPE CXX_MODULES FILES ${M_SOURCES})
@@ -68,8 +63,7 @@ function(AddFGLLibrary NAME MODE SRC_SOURCES_LOCATION INCLUDE_SOURCES_LOCATION)
file(GLOB_RECURSE INCLUDE_HPP_SOURCES CONFIGURE_DEPENDS ${INCLUDE_SOURCES_LOCATION}/**.hpp)
add_library(${NAME} ${MODE})
target_sources(${NAME} PUBLIC ${SOURCES})
target_sources(${NAME} PUBLIC FILE_SET modules TYPE CXX_MODULES FILES ${INCLUDE_MODULE_SOURCES})
target_sources(${NAME} PRIVATE ${SOURCES})
ConfigureFGLTarget(${NAME} ${SRC_SOURCES_LOCATION} ${INCLUDE_SOURCES_LOCATION})