c++ - How can I configure cmake to compile a file twice with two different compilers? -
i'm adding sycl/opencl kernel parallel c++ program built cmake. using sycl means need cmake compile c++ source file twice: once sycl compiler, , once project's default compiler, gcc. both compilations produce outputs need included when linking.
i'm new cmake. i've added gcc compile , link steps project's cmakelists.txt, what's best way add sycl compile step? i'm trying "add_custom_command" option "pre_build", command run doesn't seem know paths provided normal compile , link steps: current working directory, include directories, source directories, etc. i'm having specify of these manually, , i'm having figure of them out first.
it feels i'm doing hard way. there recommended (or @ least better) way cmake compile file twice 2 different compilers?
also, there used sycl tag, it's disappeared. can recreate it, please?
be aware pre_build works pre_build in visual studio 7, for other targets pre_link.
if need use 2 compilers on same source file, add dependency gcc compile , link custom target using, gcc executed after sycl compiler.
Comments
Post a Comment