vectorscan/util/CMakeLists.txt
Mitchell Wasson 9c139c3a6d Correct set_source_files_properties usage
The use of `CMAKE_BINARY_DIR` and `CMAKE_CURRENT_BINARY_DIR` when
specifying files to set_source_files_properties caused problems
when this project is used from another CMake project.

More specifically, these variables aren't set to the expected path,
and the properties are attempted to be set for non-existant files.

This was benign before vectorscan 5.4.8 as the only properties
set were warning suppression flags.

Starting with 5.4.9, `-funsigned-char` was applied to Ragel outputs
using this method. The result is projects depending on Vectorscan
through Cmake do not have this compile flag properly applied.
2023-10-31 09:35:50 -06:00

50 lines
1.2 KiB
CMake

# utility libs
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS} ${HS_CXX_FLAGS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR})
message("RAGEL_C_FLAGS" ${RAGEL_C_FLAGS})
set_source_files_properties(
ExpressionParser.cpp
PROPERTIES
COMPILE_FLAGS "${RAGEL_C_FLAGS}")
ragelmaker(ExpressionParser.rl)
set(expressionutil_SRCS
expressions.cpp
expressions.h
ExpressionParser.h
ExpressionParser.cpp
)
add_library(expressionutil STATIC ${expressionutil_SRCS})
add_dependencies(expressionutil ragel_ExpressionParser)
SET(corpusomatic_SRCS
ng_corpus_editor.h
ng_corpus_editor.cpp
ng_corpus_generator.h
ng_corpus_generator.cpp
ng_corpus_properties.h
ng_corpus_properties.cpp
ng_find_matches.h
ng_find_matches.cpp
)
add_library(corpusomatic STATIC ${corpusomatic_SRCS})
set(databaseutil_SRCS
database_util.cpp
database_util.h
)
add_library(databaseutil STATIC ${databaseutil_SRCS})
set(crosscompileutil_SRCS
cross_compile.cpp
cross_compile.h
)
add_library(crosscompileutil STATIC ${crosscompileutil_SRCS})