Nix-shell, emacs and cmake compiler arguments

I’m developing a C++ program right now and I’m using cmake to build it. The C++ standard I chose is C++17, so I added

set_target_propreties (mytarget PROPERTIES CXX_STANDARD 17)

to my CMakeLists.txt. This works, and builds (using a very simple default.nix using just nativeBuildInputs = [cmake];, but my emacs doesn’t seem to use these flags to check the code. Can I mitigate that?