[CMake] Fix compilation of shared module on Linux