]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Correct set_source_files_properties usage 189/head
authorMitchell Wasson <miwasson@cisco.com>
Tue, 31 Oct 2023 15:09:48 +0000 (09:09 -0600)
committerMitchell Wasson <miwasson@cisco.com>
Tue, 31 Oct 2023 15:35:50 +0000 (09:35 -0600)
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.

CMakeLists.txt
tools/hscollider/CMakeLists.txt
util/CMakeLists.txt

index 16a6dab723efb97ff5730946839ae325d414b010..7e52ca73f786343f2fb9349d730e4f7632ce42d9 100644 (file)
@@ -193,14 +193,14 @@ endif()
 set(RAGEL_C_FLAGS "-Wno-unused -funsigned-char")
 
 set_source_files_properties(
-    ${CMAKE_BINARY_DIR}/src/parser/Parser.cpp
+    src/parser/Parser.cpp
     PROPERTIES
         COMPILE_FLAGS "${RAGEL_C_FLAGS}")
 
 ragelmaker(src/parser/Parser.rl)
 
 set_source_files_properties(
-    ${CMAKE_BINARY_DIR}/src/parser/control_verbs.cpp
+   src/parser/control_verbs.cpp
     PROPERTIES
         COMPILE_FLAGS "${RAGEL_C_FLAGS}")
 
index d1ffc49add5c49eecd7bb10c6a18c7d98985f1ca..f9e71404c64f6648308af4d6675cfa1959488f56 100644 (file)
@@ -17,7 +17,7 @@ CHECK_FUNCTION_EXISTS(sigaction HAVE_SIGACTION)
 CHECK_FUNCTION_EXISTS(setrlimit HAVE_SETRLIMIT)
 
 set_source_files_properties(
-    ${CMAKE_CURRENT_BINARY_DIR}/ColliderCorporaParser.cpp
+    ColliderCorporaParser.cpp
     PROPERTIES
     COMPILE_FLAGS "${RAGEL_C_FLAGS} -I${CMAKE_CURRENT_SOURCE_DIR}")
 
index 214da90cb9553a2854797892c3445df596d08ced..97fd4c7d98e6421b12bb8d239852f9c07caeb534 100644 (file)
@@ -9,7 +9,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
 message("RAGEL_C_FLAGS" ${RAGEL_C_FLAGS})
 
 set_source_files_properties(
-    ${CMAKE_BINARY_DIR}/util/ExpressionParser.cpp
+    ExpressionParser.cpp
     PROPERTIES
     COMPILE_FLAGS "${RAGEL_C_FLAGS}")